Skip to content

Commit 621bb5d

Browse files
committed
Pushing the docs to dev/ for branch: master, commit e0c60fe6078f88ecd8b8b38179af51160c234018
1 parent 4e9a60c commit 621bb5d

File tree

934 files changed

+2624
-2698
lines changed

Some content is hidden

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

934 files changed

+2624
-2698
lines changed
-585 Bytes
Binary file not shown.
-161 Bytes
Binary file not shown.

dev/_downloads/plot_digits_pipe.ipynb

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -24,43 +24,7 @@
2424
"execution_count": null,
2525
"cell_type": "code",
2626
"source": [
27-
"print(__doc__)\n\n\n# Code source: Ga\u00ebl Varoquaux\n# Modified for documentation by Jaques Grobler\n# License: BSD 3 clause\n\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom sklearn import linear_model, decomposition, datasets\nfrom sklearn.pipeline import Pipeline\nfrom sklearn.model_selection import GridSearchCV\n\nlogistic = linear_model.LogisticRegression()\n\npca = decomposition.PCA()\npipe = Pipeline(steps=[('pca', pca), ('logistic', logistic)])\n\ndigits = datasets.load_digits()\nX_digits = digits.data\ny_digits = digits.target"
28-
],
29-
"outputs": [],
30-
"metadata": {
31-
"collapsed": false
32-
}
33-
},
34-
{
35-
"source": [
36-
"Plot the PCA spectrum\n\n"
37-
],
38-
"cell_type": "markdown",
39-
"metadata": {}
40-
},
41-
{
42-
"execution_count": null,
43-
"cell_type": "code",
44-
"source": [
45-
"pca.fit(X_digits)\n\nplt.figure(1, figsize=(4, 3))\nplt.clf()\nplt.axes([.2, .2, .7, .7])\nplt.plot(pca.explained_variance_, linewidth=2)\nplt.axis('tight')\nplt.xlabel('n_components')\nplt.ylabel('explained_variance_')"
46-
],
47-
"outputs": [],
48-
"metadata": {
49-
"collapsed": false
50-
}
51-
},
52-
{
53-
"source": [
54-
"Prediction\n\n"
55-
],
56-
"cell_type": "markdown",
57-
"metadata": {}
58-
},
59-
{
60-
"execution_count": null,
61-
"cell_type": "code",
62-
"source": [
63-
"n_components = [20, 40, 64]\nCs = np.logspace(-4, 4, 3)\n\n#Parameters of pipelines can be set using \u2018__\u2019 separated parameter names:\n\nestimator = GridSearchCV(pipe,\n dict(pca__n_components=n_components,\n logistic__C=Cs))\nestimator.fit(X_digits, y_digits)\n\nplt.axvline(estimator.best_estimator_.named_steps['pca'].n_components,\n linestyle=':', label='n_components chosen')\nplt.legend(prop=dict(size=12))\nplt.show()"
27+
"print(__doc__)\n\n\n# Code source: Ga\u00ebl Varoquaux\n# Modified for documentation by Jaques Grobler\n# License: BSD 3 clause\n\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom sklearn import linear_model, decomposition, datasets\nfrom sklearn.pipeline import Pipeline\nfrom sklearn.model_selection import GridSearchCV\n\nlogistic = linear_model.LogisticRegression()\n\npca = decomposition.PCA()\npipe = Pipeline(steps=[('pca', pca), ('logistic', logistic)])\n\ndigits = datasets.load_digits()\nX_digits = digits.data\ny_digits = digits.target\n\n# Plot the PCA spectrum\npca.fit(X_digits)\n\nplt.figure(1, figsize=(4, 3))\nplt.clf()\nplt.axes([.2, .2, .7, .7])\nplt.plot(pca.explained_variance_, linewidth=2)\nplt.axis('tight')\nplt.xlabel('n_components')\nplt.ylabel('explained_variance_')\n\n# Prediction\nn_components = [20, 40, 64]\nCs = np.logspace(-4, 4, 3)\n\n# Parameters of pipelines can be set using \u2018__\u2019 separated parameter names:\nestimator = GridSearchCV(pipe,\n dict(pca__n_components=n_components,\n logistic__C=Cs))\nestimator.fit(X_digits, y_digits)\n\nplt.axvline(estimator.best_estimator_.named_steps['pca'].n_components,\n linestyle=':', label='n_components chosen')\nplt.legend(prop=dict(size=12))\nplt.show()"
6428
],
6529
"outputs": [],
6630
"metadata": {

dev/_downloads/plot_digits_pipe.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
X_digits = digits.data
3737
y_digits = digits.target
3838

39-
###############################################################################
4039
# Plot the PCA spectrum
4140
pca.fit(X_digits)
4241

@@ -48,14 +47,11 @@
4847
plt.xlabel('n_components')
4948
plt.ylabel('explained_variance_')
5049

51-
###############################################################################
5250
# Prediction
53-
5451
n_components = [20, 40, 64]
5552
Cs = np.logspace(-4, 4, 3)
5653

57-
#Parameters of pipelines can be set using ‘__’ separated parameter names:
58-
54+
# Parameters of pipelines can be set using ‘__’ separated parameter names:
5955
estimator = GridSearchCV(pipe,
6056
dict(pca__n_components=n_components,
6157
logistic__C=Cs))

dev/_downloads/scikit-learn-docs.pdf

-23.9 KB
Binary file not shown.
73 Bytes
73 Bytes
-42 Bytes
-42 Bytes
477 Bytes

0 commit comments

Comments
 (0)