Skip to content

Commit 6b1d743

Browse files
committed
Pushing the docs to dev/ for branch: master, commit 68b981f183d4e1a89f8d53a8cde1a7772898f591
1 parent 2d52e15 commit 6b1d743

File tree

1,074 files changed

+3336
-3323
lines changed

Some content is hidden

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

1,074 files changed

+3336
-3323
lines changed
-4 Bytes
Binary file not shown.
-6 Bytes
Binary file not shown.

dev/_downloads/plot_rbf_parameters.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"cell_type": "markdown",
1616
"metadata": {},
1717
"source": [
18-
"\n# RBF SVM parameters\n\n\nThis example illustrates the effect of the parameters ``gamma`` and ``C`` of\nthe Radial Basis Function (RBF) kernel SVM.\n\nIntuitively, the ``gamma`` parameter defines how far the influence of a single\ntraining example reaches, with low values meaning 'far' and high values meaning\n'close'. The ``gamma`` parameters can be seen as the inverse of the radius of\ninfluence of samples selected by the model as support vectors.\n\nThe ``C`` parameter trades off correct classification of training examples \nagainst maximization of the decision function's margin. For larger values of \n``C``, a smaller margin will be accepted if the decision function is better at \nclassifying all training points correctly. A lower ``C`` will encourage a larger \nmargin, therefore a simpler decision function, at the cost of training accuracy.\nIn other words``C`` behaves as a regularization parameter in the SVM.\n\nThe first plot is a visualization of the decision function for a variety of\nparameter values on a simplified classification problem involving only 2 input\nfeatures and 2 possible target classes (binary classification). Note that this\nkind of plot is not possible to do for problems with more features or target\nclasses.\n\nThe second plot is a heatmap of the classifier's cross-validation accuracy as a\nfunction of ``C`` and ``gamma``. For this example we explore a relatively large\ngrid for illustration purposes. In practice, a logarithmic grid from\n$10^{-3}$ to $10^3$ is usually sufficient. If the best parameters\nlie on the boundaries of the grid, it can be extended in that direction in a\nsubsequent search.\n\nNote that the heat map plot has a special colorbar with a midpoint value close\nto the score values of the best performing models so as to make it easy to tell\nthem apart in the blink of an eye.\n\nThe behavior of the model is very sensitive to the ``gamma`` parameter. If\n``gamma`` is too large, the radius of the area of influence of the support\nvectors only includes the support vector itself and no amount of\nregularization with ``C`` will be able to prevent overfitting.\n\nWhen ``gamma`` is very small, the model is too constrained and cannot capture\nthe complexity or \"shape\" of the data. The region of influence of any selected\nsupport vector would include the whole training set. The resulting model will\nbehave similarly to a linear model with a set of hyperplanes that separate the\ncenters of high density of any pair of two classes.\n\nFor intermediate values, we can see on the second plot that good models can\nbe found on a diagonal of ``C`` and ``gamma``. Smooth models (lower ``gamma``\nvalues) can be made more complex by increasing the importance of classifying\neach point correctly (larger ``C`` values) hence the diagonal of good performing\nmodels.\n\nFinally one can also observe that for some intermediate values of ``gamma`` we\nget equally performing models when ``C`` becomes very large: it is not necessary\nto regularize by enforcing a larger margin. The radius of the RBF kernel alone \nacts as a good structural regularizer. In practice though it might still be \ninteresting to simplify the decision function with a lower value of ``C`` so as\nto favor models that use less memory and that are faster to predict.\n\nWe should also note that small differences in scores results from the random\nsplits of the cross-validation procedure. Those spurious variations can be\nsmoothed out by increasing the number of CV iterations ``n_splits`` at the\nexpense of compute time. Increasing the value number of ``C_range`` and\n``gamma_range`` steps will increase the resolution of the hyper-parameter heat\nmap.\n\n\n"
18+
"\n# RBF SVM parameters\n\n\nThis example illustrates the effect of the parameters ``gamma`` and ``C`` of\nthe Radial Basis Function (RBF) kernel SVM.\n\nIntuitively, the ``gamma`` parameter defines how far the influence of a single\ntraining example reaches, with low values meaning 'far' and high values meaning\n'close'. The ``gamma`` parameters can be seen as the inverse of the radius of\ninfluence of samples selected by the model as support vectors.\n\nThe ``C`` parameter trades off correct classification of training examples\nagainst maximization of the decision function's margin. For larger values of\n``C``, a smaller margin will be accepted if the decision function is better at\nclassifying all training points correctly. A lower ``C`` will encourage a\nlarger margin, therefore a simpler decision function, at the cost of training\naccuracy. In other words``C`` behaves as a regularization parameter in the\nSVM.\n\nThe first plot is a visualization of the decision function for a variety of\nparameter values on a simplified classification problem involving only 2 input\nfeatures and 2 possible target classes (binary classification). Note that this\nkind of plot is not possible to do for problems with more features or target\nclasses.\n\nThe second plot is a heatmap of the classifier's cross-validation accuracy as a\nfunction of ``C`` and ``gamma``. For this example we explore a relatively large\ngrid for illustration purposes. In practice, a logarithmic grid from\n$10^{-3}$ to $10^3$ is usually sufficient. If the best parameters\nlie on the boundaries of the grid, it can be extended in that direction in a\nsubsequent search.\n\nNote that the heat map plot has a special colorbar with a midpoint value close\nto the score values of the best performing models so as to make it easy to tell\nthem apart in the blink of an eye.\n\nThe behavior of the model is very sensitive to the ``gamma`` parameter. If\n``gamma`` is too large, the radius of the area of influence of the support\nvectors only includes the support vector itself and no amount of\nregularization with ``C`` will be able to prevent overfitting.\n\nWhen ``gamma`` is very small, the model is too constrained and cannot capture\nthe complexity or \"shape\" of the data. The region of influence of any selected\nsupport vector would include the whole training set. The resulting model will\nbehave similarly to a linear model with a set of hyperplanes that separate the\ncenters of high density of any pair of two classes.\n\nFor intermediate values, we can see on the second plot that good models can\nbe found on a diagonal of ``C`` and ``gamma``. Smooth models (lower ``gamma``\nvalues) can be made more complex by increasing the importance of classifying\neach point correctly (larger ``C`` values) hence the diagonal of good\nperforming models.\n\nFinally one can also observe that for some intermediate values of ``gamma`` we\nget equally performing models when ``C`` becomes very large: it is not\nnecessary to regularize by enforcing a larger margin. The radius of the RBF\nkernel alone acts as a good structural regularizer. In practice though it\nmight still be interesting to simplify the decision function with a lower\nvalue of ``C`` so as to favor models that use less memory and that are faster\nto predict.\n\nWe should also note that small differences in scores results from the random\nsplits of the cross-validation procedure. Those spurious variations can be\nsmoothed out by increasing the number of CV iterations ``n_splits`` at the\nexpense of compute time. Increasing the value number of ``C_range`` and\n``gamma_range`` steps will increase the resolution of the hyper-parameter heat\nmap.\n\n\n"
1919
]
2020
},
2121
{

dev/_downloads/plot_rbf_parameters.py

+15-13
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@
1111
'close'. The ``gamma`` parameters can be seen as the inverse of the radius of
1212
influence of samples selected by the model as support vectors.
1313
14-
The ``C`` parameter trades off correct classification of training examples
15-
against maximization of the decision function's margin. For larger values of
16-
``C``, a smaller margin will be accepted if the decision function is better at
17-
classifying all training points correctly. A lower ``C`` will encourage a larger
18-
margin, therefore a simpler decision function, at the cost of training accuracy.
19-
In other words``C`` behaves as a regularization parameter in the SVM.
14+
The ``C`` parameter trades off correct classification of training examples
15+
against maximization of the decision function's margin. For larger values of
16+
``C``, a smaller margin will be accepted if the decision function is better at
17+
classifying all training points correctly. A lower ``C`` will encourage a
18+
larger margin, therefore a simpler decision function, at the cost of training
19+
accuracy. In other words``C`` behaves as a regularization parameter in the
20+
SVM.
2021
2122
The first plot is a visualization of the decision function for a variety of
2223
parameter values on a simplified classification problem involving only 2 input
@@ -49,15 +50,16 @@
4950
For intermediate values, we can see on the second plot that good models can
5051
be found on a diagonal of ``C`` and ``gamma``. Smooth models (lower ``gamma``
5152
values) can be made more complex by increasing the importance of classifying
52-
each point correctly (larger ``C`` values) hence the diagonal of good performing
53-
models.
53+
each point correctly (larger ``C`` values) hence the diagonal of good
54+
performing models.
5455
5556
Finally one can also observe that for some intermediate values of ``gamma`` we
56-
get equally performing models when ``C`` becomes very large: it is not necessary
57-
to regularize by enforcing a larger margin. The radius of the RBF kernel alone
58-
acts as a good structural regularizer. In practice though it might still be
59-
interesting to simplify the decision function with a lower value of ``C`` so as
60-
to favor models that use less memory and that are faster to predict.
57+
get equally performing models when ``C`` becomes very large: it is not
58+
necessary to regularize by enforcing a larger margin. The radius of the RBF
59+
kernel alone acts as a good structural regularizer. In practice though it
60+
might still be interesting to simplify the decision function with a lower
61+
value of ``C`` so as to favor models that use less memory and that are faster
62+
to predict.
6163
6264
We should also note that small differences in scores results from the random
6365
splits of the cross-validation procedure. Those spurious variations can be

dev/_downloads/scikit-learn-docs.pdf

-7.39 KB
Binary file not shown.

dev/_images/iris.png

0 Bytes
-523 Bytes
-127 Bytes
-127 Bytes
-44 Bytes
154 Bytes
154 Bytes
-300 Bytes
-300 Bytes
33 Bytes
-5 Bytes
-148 Bytes
161 Bytes
-213 Bytes
186 Bytes
-122 Bytes
-122 Bytes
-59 Bytes
-59 Bytes
234 Bytes
234 Bytes
17 Bytes
17 Bytes
-43 Bytes
-43 Bytes
52 Bytes
52 Bytes
-65 Bytes
-65 Bytes
372 Bytes
372 Bytes
-60 Bytes
3 Bytes
-109 Bytes
-109 Bytes
794 Bytes
145 Bytes
206 Bytes
-637 Bytes
-88 Bytes
-88 Bytes
-45 Bytes
-19 Bytes

dev/_sources/auto_examples/applications/plot_face_recognition.rst.txt

+21-21

dev/_sources/auto_examples/applications/plot_model_complexity_influence.rst.txt

+15-15

0 commit comments

Comments
 (0)