Skip to content

Commit 1533553

Browse files
committed
Pushing the docs to dev/ for branch: main, commit 38173e9c4e4ec422611d6c4e50af54d76ebe5863
1 parent 78c106c commit 1533553

File tree

1,201 files changed

+4405
-4316
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,201 files changed

+4405
-4316
lines changed
Binary file not shown.

dev/_downloads/1e0968da80ca868bbdf21c1d0547f68c/plot_lle_digits.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
},
8181
"outputs": [],
8282
"source": [
83-
"import numpy as np\nfrom matplotlib import offsetbox\nfrom sklearn.preprocessing import MinMaxScaler\n\n\ndef plot_embedding(X, title, ax):\n X = MinMaxScaler().fit_transform(X)\n for digit in digits.target_names:\n ax.scatter(\n *X[y == digit].T,\n marker=f\"${digit}$\",\n s=60,\n color=plt.cm.Dark2(digit),\n alpha=0.425,\n zorder=2,\n )\n shown_images = np.array([[1.0, 1.0]]) # just something big\n for i in range(X.shape[0]):\n # plot every digit on the embedding\n # show an annotation box for a group of digits\n dist = np.sum((X[i] - shown_images) ** 2, 1)\n if np.min(dist) < 4e-3:\n # don't show points that are too close\n continue\n shown_images = np.concatenate([shown_images, [X[i]]], axis=0)\n imagebox = offsetbox.AnnotationBbox(\n offsetbox.OffsetImage(digits.images[i], cmap=plt.cm.gray_r), X[i]\n )\n imagebox.set(zorder=1)\n ax.add_artist(imagebox)\n\n ax.set_title(title)\n ax.axis(\"off\")"
83+
"import numpy as np\nfrom matplotlib import offsetbox\nfrom sklearn.preprocessing import MinMaxScaler\n\n\ndef plot_embedding(X, title):\n _, ax = plt.subplots()\n X = MinMaxScaler().fit_transform(X)\n\n for digit in digits.target_names:\n ax.scatter(\n *X[y == digit].T,\n marker=f\"${digit}$\",\n s=60,\n color=plt.cm.Dark2(digit),\n alpha=0.425,\n zorder=2,\n )\n shown_images = np.array([[1.0, 1.0]]) # just something big\n for i in range(X.shape[0]):\n # plot every digit on the embedding\n # show an annotation box for a group of digits\n dist = np.sum((X[i] - shown_images) ** 2, 1)\n if np.min(dist) < 4e-3:\n # don't show points that are too close\n continue\n shown_images = np.concatenate([shown_images, [X[i]]], axis=0)\n imagebox = offsetbox.AnnotationBbox(\n offsetbox.OffsetImage(digits.images[i], cmap=plt.cm.gray_r), X[i]\n )\n imagebox.set(zorder=1)\n ax.add_artist(imagebox)\n\n ax.set_title(title)\n ax.axis(\"off\")"
8484
]
8585
},
8686
{
@@ -134,7 +134,7 @@
134134
},
135135
"outputs": [],
136136
"source": [
137-
"from itertools import zip_longest\n\nfig, axs = plt.subplots(nrows=7, ncols=2, figsize=(17, 24))\n\nfor name, ax in zip_longest(timing, axs.ravel()):\n if name is None:\n ax.axis(\"off\")\n continue\n title = f\"{name} (time {timing[name]:.3f}s)\"\n plot_embedding(projections[name], title, ax)\n\nplt.show()"
137+
"for name in timing:\n title = f\"{name} (time {timing[name]:.3f}s)\"\n plot_embedding(projections[name], title)\n\nplt.show()"
138138
]
139139
}
140140
],
Binary file not shown.

dev/_downloads/9d97cc4ed755b7f2c7f9311bccc89a00/plot_lle_digits.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@
4848
from sklearn.preprocessing import MinMaxScaler
4949

5050

51-
def plot_embedding(X, title, ax):
51+
def plot_embedding(X, title):
52+
_, ax = plt.subplots()
5253
X = MinMaxScaler().fit_transform(X)
54+
5355
for digit in digits.target_names:
5456
ax.scatter(
5557
*X[y == digit].T,
@@ -175,15 +177,8 @@ def plot_embedding(X, title, ax):
175177

176178
# %%
177179
# Finally, we can plot the resulting projection given by each method.
178-
from itertools import zip_longest
179-
180-
fig, axs = plt.subplots(nrows=7, ncols=2, figsize=(17, 24))
181-
182-
for name, ax in zip_longest(timing, axs.ravel()):
183-
if name is None:
184-
ax.axis("off")
185-
continue
180+
for name in timing:
186181
title = f"{name} (time {timing[name]:.3f}s)"
187-
plot_embedding(projections[name], title, ax)
182+
plot_embedding(projections[name], title)
188183

189184
plt.show()

dev/_downloads/scikit-learn-docs.zip

88.5 KB
Binary file not shown.
-741 Bytes
-35 Bytes
190 Bytes
-17 Bytes
-11 Bytes
-17 Bytes
-100 Bytes
-4.72 KB
-691 Bytes
-322 Bytes
-1020 KB
133 KB
111 KB
116 KB
77.7 KB
36.4 KB
35.6 KB
35.3 KB
141 KB
134 KB
60.5 KB
91.9 KB
133 KB
161 Bytes
-696 Bytes
-549 Bytes
-125 Bytes
-24 Bytes
-10 Bytes

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: 4 additions & 4 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: 2 additions & 2 deletions

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

Lines changed: 1 addition & 1 deletion

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

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)