Skip to content

Commit 3335ff1

Browse files
committed
Pushing the docs to dev/ for branch: master, commit 03c3af5bdec29903567fa3d63f2e6776a2b3041b
1 parent 04061ed commit 3335ff1

File tree

1,056 files changed

+3320
-3325
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,056 files changed

+3320
-3325
lines changed
-102 Bytes
Binary file not shown.
-98 Bytes
Binary file not shown.

dev/_downloads/plot_ols_ridge_variance.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
},
2727
"outputs": [],
2828
"source": [
29-
"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\n\nX_train = np.c_[.5, 1].T\ny_train = [.5, 1]\nX_test = np.c_[0, 2].T\n\nnp.random.seed(0)\n\nclassifiers = dict(ols=linear_model.LinearRegression(),\n ridge=linear_model.Ridge(alpha=.1))\n\nfignum = 1\nfor name, clf in classifiers.items():\n fig = plt.figure(fignum, figsize=(4, 3))\n plt.clf()\n plt.title(name)\n ax = plt.axes([.12, .12, .8, .8])\n\n for _ in range(6):\n this_X = .1 * np.random.normal(size=(2, 1)) + X_train\n clf.fit(this_X, y_train)\n\n ax.plot(X_test, clf.predict(X_test), color='gray')\n ax.scatter(this_X, y_train, s=3, c='gray', marker='o', zorder=10)\n\n clf.fit(X_train, y_train)\n ax.plot(X_test, clf.predict(X_test), linewidth=2, color='blue')\n ax.scatter(X_train, y_train, s=30, c='red', marker='+', zorder=10)\n\n ax.set_xticks(())\n ax.set_yticks(())\n ax.set_ylim((0, 1.6))\n ax.set_xlabel('X')\n ax.set_ylabel('y')\n ax.set_xlim(0, 2)\n fignum += 1\n\nplt.show()"
29+
"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\n\nX_train = np.c_[.5, 1].T\ny_train = [.5, 1]\nX_test = np.c_[0, 2].T\n\nnp.random.seed(0)\n\nclassifiers = dict(ols=linear_model.LinearRegression(),\n ridge=linear_model.Ridge(alpha=.1))\n\nfor name, clf in classifiers.items():\n fig, ax = plt.subplots(figsize=(4, 3))\n\n for _ in range(6):\n this_X = .1 * np.random.normal(size=(2, 1)) + X_train\n clf.fit(this_X, y_train)\n\n ax.plot(X_test, clf.predict(X_test), color='gray')\n ax.scatter(this_X, y_train, s=3, c='gray', marker='o', zorder=10)\n\n clf.fit(X_train, y_train)\n ax.plot(X_test, clf.predict(X_test), linewidth=2, color='blue')\n ax.scatter(X_train, y_train, s=30, c='red', marker='+', zorder=10)\n\n ax.set_title(name)\n ax.set_xlim(0, 2)\n ax.set_ylim((0, 1.6))\n ax.set_xlabel('X')\n ax.set_ylabel('y')\n\n fig.tight_layout()\n\nplt.show()"
3030
]
3131
}
3232
],

dev/_downloads/plot_ols_ridge_variance.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,8 @@
4242
classifiers = dict(ols=linear_model.LinearRegression(),
4343
ridge=linear_model.Ridge(alpha=.1))
4444

45-
fignum = 1
4645
for name, clf in classifiers.items():
47-
fig = plt.figure(fignum, figsize=(4, 3))
48-
plt.clf()
49-
plt.title(name)
50-
ax = plt.axes([.12, .12, .8, .8])
46+
fig, ax = plt.subplots(figsize=(4, 3))
5147

5248
for _ in range(6):
5349
this_X = .1 * np.random.normal(size=(2, 1)) + X_train
@@ -60,12 +56,12 @@
6056
ax.plot(X_test, clf.predict(X_test), linewidth=2, color='blue')
6157
ax.scatter(X_train, y_train, s=30, c='red', marker='+', zorder=10)
6258

63-
ax.set_xticks(())
64-
ax.set_yticks(())
59+
ax.set_title(name)
60+
ax.set_xlim(0, 2)
6561
ax.set_ylim((0, 1.6))
6662
ax.set_xlabel('X')
6763
ax.set_ylabel('y')
68-
ax.set_xlim(0, 2)
69-
fignum += 1
64+
65+
fig.tight_layout()
7066

7167
plt.show()

dev/_downloads/scikit-learn-docs.pdf

334 KB
Binary file not shown.

dev/_images/iris.png

0 Bytes

0 commit comments

Comments
 (0)