Skip to content

Commit b61cc61

Browse files
committed
Pushing the docs to dev/ for branch: main, commit 9670b4243dce06255b341cb3aa613c0da0aeb212
1 parent e137314 commit b61cc61

File tree

1,291 files changed

+5265
-5268
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,291 files changed

+5265
-5268
lines changed

dev/.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: b4b9d4a66b614a428ea350785a47981b
3+
config: ba7e766cb95b85ba3a1f6ff755258a3f
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

dev/_downloads/06ffeb4f0ded6447302acd5a712f8490/plot_nearest_centroid.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-
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib.colors import ListedColormap\nfrom sklearn import datasets\nfrom sklearn.neighbors import NearestCentroid\nfrom sklearn.inspection import DecisionBoundaryDisplay\n\nn_neighbors = 15\n\n# import some data to play with\niris = datasets.load_iris()\n# we only take the first two features. We could avoid this ugly\n# slicing by using a two-dim dataset\nX = iris.data[:, :2]\ny = iris.target\n\n# Create color maps\ncmap_light = ListedColormap([\"orange\", \"cyan\", \"cornflowerblue\"])\ncmap_bold = ListedColormap([\"darkorange\", \"c\", \"darkblue\"])\n\nfor shrinkage in [None, 0.2]:\n # we create an instance of Neighbours Classifier and fit the data.\n clf = NearestCentroid(shrink_threshold=shrinkage)\n clf.fit(X, y)\n y_pred = clf.predict(X)\n print(shrinkage, np.mean(y == y_pred))\n\n _, ax = plt.subplots()\n DecisionBoundaryDisplay.from_estimator(\n clf, X, cmap=cmap_light, ax=ax, response_method=\"predict\"\n )\n\n # Plot also the training points\n plt.scatter(X[:, 0], X[:, 1], c=y, cmap=cmap_bold, edgecolor=\"k\", s=20)\n plt.title(\"3-Class classification (shrink_threshold=%r)\" % shrinkage)\n plt.axis(\"tight\")\n\nplt.show()"
18+
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib.colors import ListedColormap\nfrom sklearn import datasets\nfrom sklearn.neighbors import NearestCentroid\nfrom sklearn.inspection import DecisionBoundaryDisplay\n\n\n# import some data to play with\niris = datasets.load_iris()\n# we only take the first two features. We could avoid this ugly\n# slicing by using a two-dim dataset\nX = iris.data[:, :2]\ny = iris.target\n\n# Create color maps\ncmap_light = ListedColormap([\"orange\", \"cyan\", \"cornflowerblue\"])\ncmap_bold = ListedColormap([\"darkorange\", \"c\", \"darkblue\"])\n\nfor shrinkage in [None, 0.2]:\n # we create an instance of Nearest Centroid Classifier and fit the data.\n clf = NearestCentroid(shrink_threshold=shrinkage)\n clf.fit(X, y)\n y_pred = clf.predict(X)\n print(shrinkage, np.mean(y == y_pred))\n\n _, ax = plt.subplots()\n DecisionBoundaryDisplay.from_estimator(\n clf, X, cmap=cmap_light, ax=ax, response_method=\"predict\"\n )\n\n # Plot also the training points\n plt.scatter(X[:, 0], X[:, 1], c=y, cmap=cmap_bold, edgecolor=\"k\", s=20)\n plt.title(\"3-Class classification (shrink_threshold=%r)\" % shrinkage)\n plt.axis(\"tight\")\n\nplt.show()"
1919
]
2020
}
2121
],
Binary file not shown.

dev/_downloads/1ee82dc6471486cb5b088fc473cd945b/plot_nearest_centroid.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from sklearn.neighbors import NearestCentroid
1616
from sklearn.inspection import DecisionBoundaryDisplay
1717

18-
n_neighbors = 15
1918

2019
# import some data to play with
2120
iris = datasets.load_iris()
@@ -29,7 +28,7 @@
2928
cmap_bold = ListedColormap(["darkorange", "c", "darkblue"])
3029

3130
for shrinkage in [None, 0.2]:
32-
# we create an instance of Neighbours Classifier and fit the data.
31+
# we create an instance of Nearest Centroid Classifier and fit the data.
3332
clf = NearestCentroid(shrink_threshold=shrinkage)
3433
clf.fit(X, y)
3534
y_pred = clf.predict(X)
Binary file not shown.

dev/_downloads/scikit-learn-docs.zip

-11.2 KB
Binary file not shown.
-46 Bytes
-245 Bytes
-411 Bytes
-72 Bytes

0 commit comments

Comments
 (0)