Skip to content

Commit 78dbfcd

Browse files
committed
Pushing the docs to dev/ for branch: main, commit 2e5e52f218f5852c56291b5c18ceec8f1c75c55d
1 parent b16cdf0 commit 78dbfcd

File tree

714 files changed

+3213
-3245
lines changed

Some content is hidden

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

714 files changed

+3213
-3245
lines changed
Binary file not shown.
Binary file not shown.

dev/_downloads/a6621d4718b448229cd4e8e18fdbe4c6/plot_svm_margin.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
facecolors="none",
6464
zorder=10,
6565
edgecolors="k",
66-
cmap=plt.get_cmap("RdBu"),
6766
)
6867
plt.scatter(
6968
X[:, 0], X[:, 1], c=Y, zorder=10, cmap=plt.get_cmap("RdBu"), edgecolors="k"

dev/_downloads/e5984993ae4c01e36276dcfed2bf0838/plot_svm_margin.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"outputs": [],
1717
"source": [
18-
"# Code source: Ga\u00ebl Varoquaux\n# Modified for documentation by Jaques Grobler\n# License: BSD 3 clause\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfrom sklearn import svm\n\n# we create 40 separable points\nnp.random.seed(0)\nX = np.r_[np.random.randn(20, 2) - [2, 2], np.random.randn(20, 2) + [2, 2]]\nY = [0] * 20 + [1] * 20\n\n# figure number\nfignum = 1\n\n# fit the model\nfor name, penalty in ((\"unreg\", 1), (\"reg\", 0.05)):\n clf = svm.SVC(kernel=\"linear\", C=penalty)\n clf.fit(X, Y)\n\n # get the separating hyperplane\n w = clf.coef_[0]\n a = -w[0] / w[1]\n xx = np.linspace(-5, 5)\n yy = a * xx - (clf.intercept_[0]) / w[1]\n\n # plot the parallels to the separating hyperplane that pass through the\n # support vectors (margin away from hyperplane in direction\n # perpendicular to hyperplane). This is sqrt(1+a^2) away vertically in\n # 2-d.\n margin = 1 / np.sqrt(np.sum(clf.coef_**2))\n yy_down = yy - np.sqrt(1 + a**2) * margin\n yy_up = yy + np.sqrt(1 + a**2) * margin\n\n # plot the line, the points, and the nearest vectors to the plane\n plt.figure(fignum, figsize=(4, 3))\n plt.clf()\n plt.plot(xx, yy, \"k-\")\n plt.plot(xx, yy_down, \"k--\")\n plt.plot(xx, yy_up, \"k--\")\n\n plt.scatter(\n clf.support_vectors_[:, 0],\n clf.support_vectors_[:, 1],\n s=80,\n facecolors=\"none\",\n zorder=10,\n edgecolors=\"k\",\n cmap=plt.get_cmap(\"RdBu\"),\n )\n plt.scatter(\n X[:, 0], X[:, 1], c=Y, zorder=10, cmap=plt.get_cmap(\"RdBu\"), edgecolors=\"k\"\n )\n\n plt.axis(\"tight\")\n x_min = -4.8\n x_max = 4.2\n y_min = -6\n y_max = 6\n\n YY, XX = np.meshgrid(yy, xx)\n xy = np.vstack([XX.ravel(), YY.ravel()]).T\n Z = clf.decision_function(xy).reshape(XX.shape)\n\n # Put the result into a contour plot\n plt.contourf(XX, YY, Z, cmap=plt.get_cmap(\"RdBu\"), alpha=0.5, linestyles=[\"-\"])\n\n plt.xlim(x_min, x_max)\n plt.ylim(y_min, y_max)\n\n plt.xticks(())\n plt.yticks(())\n fignum = fignum + 1\n\nplt.show()"
18+
"# Code source: Ga\u00ebl Varoquaux\n# Modified for documentation by Jaques Grobler\n# License: BSD 3 clause\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfrom sklearn import svm\n\n# we create 40 separable points\nnp.random.seed(0)\nX = np.r_[np.random.randn(20, 2) - [2, 2], np.random.randn(20, 2) + [2, 2]]\nY = [0] * 20 + [1] * 20\n\n# figure number\nfignum = 1\n\n# fit the model\nfor name, penalty in ((\"unreg\", 1), (\"reg\", 0.05)):\n clf = svm.SVC(kernel=\"linear\", C=penalty)\n clf.fit(X, Y)\n\n # get the separating hyperplane\n w = clf.coef_[0]\n a = -w[0] / w[1]\n xx = np.linspace(-5, 5)\n yy = a * xx - (clf.intercept_[0]) / w[1]\n\n # plot the parallels to the separating hyperplane that pass through the\n # support vectors (margin away from hyperplane in direction\n # perpendicular to hyperplane). This is sqrt(1+a^2) away vertically in\n # 2-d.\n margin = 1 / np.sqrt(np.sum(clf.coef_**2))\n yy_down = yy - np.sqrt(1 + a**2) * margin\n yy_up = yy + np.sqrt(1 + a**2) * margin\n\n # plot the line, the points, and the nearest vectors to the plane\n plt.figure(fignum, figsize=(4, 3))\n plt.clf()\n plt.plot(xx, yy, \"k-\")\n plt.plot(xx, yy_down, \"k--\")\n plt.plot(xx, yy_up, \"k--\")\n\n plt.scatter(\n clf.support_vectors_[:, 0],\n clf.support_vectors_[:, 1],\n s=80,\n facecolors=\"none\",\n zorder=10,\n edgecolors=\"k\",\n )\n plt.scatter(\n X[:, 0], X[:, 1], c=Y, zorder=10, cmap=plt.get_cmap(\"RdBu\"), edgecolors=\"k\"\n )\n\n plt.axis(\"tight\")\n x_min = -4.8\n x_max = 4.2\n y_min = -6\n y_max = 6\n\n YY, XX = np.meshgrid(yy, xx)\n xy = np.vstack([XX.ravel(), YY.ravel()]).T\n Z = clf.decision_function(xy).reshape(XX.shape)\n\n # Put the result into a contour plot\n plt.contourf(XX, YY, Z, cmap=plt.get_cmap(\"RdBu\"), alpha=0.5, linestyles=[\"-\"])\n\n plt.xlim(x_min, x_max)\n plt.ylim(y_min, y_max)\n\n plt.xticks(())\n plt.yticks(())\n fignum = fignum + 1\n\nplt.show()"
1919
]
2020
}
2121
],

dev/_downloads/scikit-learn-docs.zip

7.44 KB
Binary file not shown.
-688 Bytes
-131 Bytes
126 Bytes
160 Bytes
102 Bytes
-46 Bytes
-5 Bytes
-97 Bytes
-115 Bytes
-80 Bytes
-6.23 KB
2.86 KB
75 Bytes
22 Bytes
14 Bytes
53 Bytes
90 Bytes
-125 Bytes
-80 Bytes
9 Bytes
-19 Bytes
75 Bytes
90 Bytes
-177 Bytes
81 Bytes
935 Bytes
137 Bytes
162 Bytes
-181 Bytes
-448 Bytes
-635 Bytes
721 Bytes
-159 Bytes
12 Bytes
-34 Bytes
91 Bytes
1 Byte

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

Lines changed: 1 addition & 1 deletion

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

Lines changed: 1 addition & 1 deletion

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

Lines changed: 5 additions & 5 deletions

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

Lines changed: 15 additions & 15 deletions

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

Lines changed: 29 additions & 29 deletions

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

Lines changed: 1 addition & 1 deletion

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

Lines changed: 1 addition & 1 deletion

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

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)