8000 Merge pull request #2543 from johncollins/dev · Felixhawk/scikit-learn@84094f4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 84094f4

Browse files
committed
Merge pull request scikit-learn#2543 from johncollins/dev
LOO is bad doc
2 parents 55efb67 + 4e5c637 commit 84094f4

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

doc/modules/cross_validation.rst

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ validation strategies.
165165
K-fold
166166
------
167167

168-
:class:`KFold` divides all the samples in math:`k` groups of samples,
168+
:class:`KFold` divides all the samples in :math:`k` groups of samples,
169169
called folds (if :math:`k = n`, this is equivalent to the *Leave One
170170
Out* strategy), of equal sizes (if possible). The prediction function is
171171
learned using :math:`k - 1` folds, and the fold left out is used for test.
@@ -231,6 +231,40 @@ not waste much data as only one sample is removed from the learning set::
231231
[0 1 2] [3]
232232

233233

234+
Potential users of LOO for model selection should weigh a few known caveats.
235+
When compared with *k*-fold cross validation, one builds *n* models from *n*
236+
samples instead of *k* models, where *n > k*. Moreover, each is trained on *n - 1*
237+
samples rather than *(k-1)n / k*. In both ways, assuming *k* is not too large
238+
and *k < n*, LOO is more computationally expensive than *k*-fold cross validation.
239+
240+
In terms of accuracy, LOO often results in high variance as an estimator for the
241+
test error. Intuitively, since *n - 1* of
242+
the *n* samples are used to build each model, models constructed from folds are
243+
virtually identical to each other and to the model built from the entire training
244+
set.
245+
246+
However, if the learning curve is steep for the training size in question,
247+
then 5- or 10- fold cross validation can overestimate the generalization error.
248+
249+
As a general rule, most authors, and empirical evidence, suggest that 5- or 10-
250+
fold cross validation should be preferred to LOO.
251+
252+
253+
.. topic:: References:
254+
255+
* http://www.faqs.org/faqs/ai-faq/neural-nets/part3/section-12.html
256+
* T. Hastie, R. Tibshirani, J. Friedman, `The Elements of Statistical Learning
257+
<http://www-stat.stanford.edu/~tibs/ElemStatLearn>`_, Springer 2009
258+
* L. Breiman, P. Spector `Submodel selection and evaluation in regression: The X-random case
259+
<http://digitalassets.lib.berkeley.edu/sdtr/ucb/text/197.pdf>`_, International Statistical Review 1992
260+
* R. Kohavi, `A Study of Cross-Validation and Bootstrap for Accuracy Estimation and Model Selection
261+
<http://www.cs.iastate.edu/~jtian/cs573/Papers/Kohavi-IJCAI-95.pdf>`_, Intl. Jnt. Conf. AI
262+
* R. Bharat Rao, G. Fung, R. Rosales, `On the Dangers of Cross-Validation. An Experimental Evaluation
263+
<http://www.siam.org/proceedings/datamining/2008/dm08_54_Rao.pdf>`_, SIAM 2008
264+
* G. James, D. Witten, T. Hastie, R Tibshirani, `An Introduction to Statitical Learning
265+
<http://www-bcf.usc.edu/~gareth/ISL>`_, Springer 2013
266+
267+
234268
Leave-P-Out - LPO
235269
-----------------
236270

0 commit comments

Comments
 (0)
0