Skip to content

Commit a756f4f

Browse files
committed
Pushing the docs to dev/ for branch: master, commit 6e98eec04319ba5e4e250b9af33ade31a18e4a91
1 parent c3dac6f commit a756f4f

File tree

907 files changed

+2693
-2688
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

907 files changed

+2693
-2688
lines changed
158 Bytes
Binary file not shown.
156 Bytes
Binary file not shown.

dev/_downloads/plot_nested_cross_validation_iris.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
{
1717
"source": [
18-
"\n# Nested versus non-nested cross-validation\n\n\nThis example compares non-nested and nested cross-validation strategies on a\nclassifier of the iris data set. Nested cross-validation (CV) is often used to\ntrain a model in which hyperparameters also need to be optimized. Nested CV\nestimates the generalization error of the underlying model and its\n(hyper)parameter search. Choosing the parameters that maximize non-nested CV\nbiases the model to the dataset, yielding an overly-optimistic score.\n\nModel selection without nested CV uses the same data to tune model parameters\nand evaluate model performance. Information may thus \"leak\" into the model\nand overfit the data. The magnitude of this effect is primarily dependent on\nthe size of the dataset and the stability of the model. See Cawley and Talbot\n[1]_ for an analysis of these issues.\n\nTo avoid this problem, nested CV effectively uses a series of\ntrain/validation/test set splits. In the inner loop, the score is approximately\nmaximized by fitting a model to each training set, and then directly maximized\nin selecting (hyper)parameters over the validation set. In the outer loop,\ngeneralization error is estimated by averaging test set scores over several\ndataset splits.\n\nThe example below uses a support vector classifier with a non-linear kernel to\nbuild a model with optimized hyperparameters by grid search. We compare the\nperformance of non-nested and nested CV strategies by taking the difference\nbetween their scores.\n\n.. topic:: See Also:\n\n - `cross_validation`\n - `grid_search`\n\n.. topic:: References:\n\n .. [1] `Cawley, G.C.; Talbot, N.L.C. On over-fitting in model selection and\n subsequent selection bias in performance evaluation.\n J. Mach. Learn. Res 2010,11, 2079-2107.\n <http://jmlr.csail.mit.edu/papers/volume11/cawley10a/cawley10a.pdf>`_\n\n\n"
18+
"\n# Nested versus non-nested cross-validation\n\n\nThis example compares non-nested and nested cross-validation strategies on a\nclassifier of the iris data set. Nested cross-validation (CV) is often used to\ntrain a model in which hyperparameters also need to be optimized. Nested CV\nestimates the generalization error of the underlying model and its\n(hyper)parameter search. Choosing the parameters that maximize non-nested CV\nbiases the model to the dataset, yielding an overly-optimistic score.\n\nModel selection without nested CV uses the same data to tune model parameters\nand evaluate model performance. Information may thus \"leak\" into the model\nand overfit the data. The magnitude of this effect is primarily dependent on\nthe size of the dataset and the stability of the model. See Cawley and Talbot\n[1]_ for an analysis of these issues.\n\nTo avoid this problem, nested CV effectively uses a series of\ntrain/validation/test set splits. In the inner loop (here executed by\n:class:`GridSearchCV <sklearn.model_selection.GridSearchCV>`), the score is\napproximately maximized by fitting a model to each training set, and then\ndirectly maximized in selecting (hyper)parameters over the validation set. In\nthe outer loop (here in :func:`cross_val_score\n<sklearn.model_selection.cross_val_score>`), generalization error is estimated\nby averaging test set scores over several dataset splits.\n\nThe example below uses a support vector classifier with a non-linear kernel to\nbuild a model with optimized hyperparameters by grid search. We compare the\nperformance of non-nested and nested CV strategies by taking the difference\nbetween their scores.\n\n.. topic:: See Also:\n\n - `cross_validation`\n - `grid_search`\n\n.. topic:: References:\n\n .. [1] `Cawley, G.C.; Talbot, N.L.C. On over-fitting in model selection and\n subsequent selection bias in performance evaluation.\n J. Mach. Learn. Res 2010,11, 2079-2107.\n <http://jmlr.csail.mit.edu/papers/volume11/cawley10a/cawley10a.pdf>`_\n\n\n"
1919
],
2020
"cell_type": "markdown",
2121
"metadata": {}

dev/_downloads/plot_nested_cross_validation_iris.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@
1717
[1]_ for an analysis of these issues.
1818
1919
To avoid this problem, nested CV effectively uses a series of
20-
train/validation/test set splits. In the inner loop, the score is approximately
21-
maximized by fitting a model to each training set, and then directly maximized
22-
in selecting (hyper)parameters over the validation set. In the outer loop,
23-
generalization error is estimated by averaging test set scores over several
24-
dataset splits.
20+
train/validation/test set splits. In the inner loop (here executed by
21+
:class:`GridSearchCV <sklearn.model_selection.GridSearchCV>`), the score is
22+
approximately maximized by fitting a model to each training set, and then
23+
directly maximized in selecting (hyper)parameters over the validation set. In
24+
the outer loop (here in :func:`cross_val_score
25+
<sklearn.model_selection.cross_val_score>`), generalization error is estimated
26+
by averaging test set scores over several dataset splits.
2527
2628
The example below uses a support vector classifier with a non-linear kernel to
2729
build a model with optimized hyperparameters by grid search. We compare the

dev/_downloads/scikit-learn-docs.pdf

-6.08 KB
Binary file not shown.

0 commit comments

Comments
 (0)