Skip to content

Commit 1a1687c

Browse files
committed
Pushing the docs to dev/ for branch: main, commit 768c01d0c625549681609371381bf5dfda51ed81
1 parent aa0842d commit 1a1687c

File tree

1,370 files changed

+4789
-4800
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,370 files changed

+4789
-4800
lines changed
Binary file not shown.

dev/_downloads/1e0968da80ca868bbdf21c1d0547f68c/plot_lle_digits.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
},
9999
"outputs": [],
100100
"source": [
101-
"from sklearn.decomposition import TruncatedSVD\nfrom sklearn.discriminant_analysis import LinearDiscriminantAnalysis\nfrom sklearn.ensemble import RandomTreesEmbedding\nfrom sklearn.manifold import (\n Isomap,\n LocallyLinearEmbedding,\n MDS,\n SpectralEmbedding,\n TSNE,\n)\nfrom sklearn.neighbors import NeighborhoodComponentsAnalysis\nfrom sklearn.pipeline import make_pipeline\nfrom sklearn.random_projection import SparseRandomProjection\n\nembeddings = {\n \"Random projection embedding\": SparseRandomProjection(\n n_components=2, random_state=42\n ),\n \"Truncated SVD embedding\": TruncatedSVD(n_components=2),\n \"Linear Discriminant Analysis embedding\": LinearDiscriminantAnalysis(\n n_components=2\n ),\n \"Isomap embedding\": Isomap(n_neighbors=n_neighbors, n_components=2),\n \"Standard LLE embedding\": LocallyLinearEmbedding(\n n_neighbors=n_neighbors, n_components=2, method=\"standard\"\n ),\n \"Modified LLE embedding\": LocallyLinearEmbedding(\n n_neighbors=n_neighbors, n_components=2, method=\"modified\"\n ),\n \"Hessian LLE embedding\": LocallyLinearEmbedding(\n n_neighbors=n_neighbors, n_components=2, method=\"hessian\"\n ),\n \"LTSA LLE embedding\": LocallyLinearEmbedding(\n n_neighbors=n_neighbors, n_components=2, method=\"ltsa\"\n ),\n \"MDS embedding\": MDS(n_components=2, n_init=1, max_iter=120, n_jobs=2),\n \"Random Trees embedding\": make_pipeline(\n RandomTreesEmbedding(n_estimators=200, max_depth=5, random_state=0),\n TruncatedSVD(n_components=2),\n ),\n \"Spectral embedding\": SpectralEmbedding(\n n_components=2, random_state=0, eigen_solver=\"arpack\"\n ),\n \"t-SNE embeedding\": TSNE(\n n_components=2,\n n_iter=500,\n n_iter_without_progress=150,\n n_jobs=2,\n random_state=0,\n ),\n \"NCA embedding\": NeighborhoodComponentsAnalysis(\n n_components=2, init=\"pca\", random_state=0\n ),\n}"
101+
"from sklearn.decomposition import TruncatedSVD\nfrom sklearn.discriminant_analysis import LinearDiscriminantAnalysis\nfrom sklearn.ensemble import RandomTreesEmbedding\nfrom sklearn.manifold import (\n Isomap,\n LocallyLinearEmbedding,\n MDS,\n SpectralEmbedding,\n TSNE,\n)\nfrom sklearn.neighbors import NeighborhoodComponentsAnalysis\nfrom sklearn.pipeline import make_pipeline\nfrom sklearn.random_projection import SparseRandomProjection\n\nembeddings = {\n \"Random projection embedding\": SparseRandomProjection(\n n_components=2, random_state=42\n ),\n \"Truncated SVD embedding\": TruncatedSVD(n_components=2),\n \"Linear Discriminant Analysis embedding\": LinearDiscriminantAnalysis(\n n_components=2\n ),\n \"Isomap embedding\": Isomap(n_neighbors=n_neighbors, n_components=2),\n \"Standard LLE embedding\": LocallyLinearEmbedding(\n n_neighbors=n_neighbors, n_components=2, method=\"standard\"\n ),\n \"Modified LLE embedding\": LocallyLinearEmbedding(\n n_neighbors=n_neighbors, n_components=2, method=\"modified\"\n ),\n \"Hessian LLE embedding\": LocallyLinearEmbedding(\n n_neighbors=n_neighbors, n_components=2, method=\"hessian\"\n ),\n \"LTSA LLE embedding\": LocallyLinearEmbedding(\n n_neighbors=n_neighbors, n_components=2, method=\"ltsa\"\n ),\n \"MDS embedding\": MDS(\n n_components=2, n_init=1, max_iter=120, n_jobs=2, normalized_stress=\"auto\"\n ),\n \"Random Trees embedding\": make_pipeline(\n RandomTreesEmbedding(n_estimators=200, max_depth=5, random_state=0),\n TruncatedSVD(n_components=2),\n ),\n \"Spectral embedding\": SpectralEmbedding(\n n_components=2, random_state=0, eigen_solver=\"arpack\"\n ),\n \"t-SNE embeedding\": TSNE(\n n_components=2,\n n_iter=500,\n n_iter_without_progress=150,\n n_jobs=2,\n random_state=0,\n ),\n \"NCA embedding\": NeighborhoodComponentsAnalysis(\n n_components=2, init=\"pca\", random_state=0\n ),\n}"
102102
]
103103
},
104104
{

dev/_downloads/3c9b7bcd0b16f172ac12ffad61f3b5f0/plot_stack_predictors.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
},
4545
"outputs": [],
4646
"source": [
47-
"import numpy as np\n\nfrom sklearn.datasets import fetch_openml\nfrom sklearn.utils import shuffle\n\n\ndef load_ames_housing():\n df = fetch_openml(name=\"house_prices\", as_frame=True, parser=\"pandas\")\n X = df.data\n y = df.target\n\n features = [\n \"YrSold\",\n \"HeatingQC\",\n \"Street\",\n \"YearRemodAdd\",\n \"Heating\",\n \"MasVnrType\",\n \"BsmtUnfSF\",\n \"Foundation\",\n \"MasVnrArea\",\n \"MSSubClass\",\n \"ExterQual\",\n \"Condition2\",\n \"GarageCars\",\n \"GarageType\",\n \"OverallQual\",\n \"TotalBsmtSF\",\n \"BsmtFinSF1\",\n \"HouseStyle\",\n \"MiscFeature\",\n \"MoSold\",\n ]\n\n X = X[features]\n X, y = shuffle(X, y, random_state=0)\n\n X = X[:600]\n y = y[:600]\n return X, np.log(y)\n\n\nX, y = load_ames_housing()"
47+
"import numpy as np\n\nfrom sklearn.datasets import fetch_openml\nfrom sklearn.utils import shuffle\n\n\ndef load_ames_housing():\n df = fetch_openml(name=\"house_prices\", as_frame=True, parser=\"pandas\")\n X = df.data\n y = df.target\n\n features = [\n \"YrSold\",\n \"HeatingQC\",\n \"Street\",\n \"YearRemodAdd\",\n \"Heating\",\n \"MasVnrType\",\n \"BsmtUnfSF\",\n \"Foundation\",\n \"MasVnrArea\",\n \"MSSubClass\",\n \"ExterQual\",\n \"Condition2\",\n \"GarageCars\",\n \"GarageType\",\n \"OverallQual\",\n \"TotalBsmtSF\",\n \"BsmtFinSF1\",\n \"HouseStyle\",\n \"MiscFeature\",\n \"MoSold\",\n ]\n\n X = X.loc[:, features]\n X, y = shuffle(X, y, random_state=0)\n\n X = X.iloc[:600]\n y = y.iloc[:600]\n return X, np.log(y)\n\n\nX, y = load_ames_housing()"
4848
]
4949
},
5050
{

dev/_downloads/4825fc8223d1af0f3b61080c3dea3a62/plot_faces_decomposition.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ def plot_gallery(title, images, n_col=n_col, n_row=n_row, cmap=plt.cm.gray):
191191
batch_size=20,
192192
max_iter=50,
193193
random_state=rng,
194+
n_init="auto",
194195
)
195196
kmeans_estimator.fit(faces_centered)
196197
plot_gallery(
Binary file not shown.

dev/_downloads/9d97cc4ed755b7f2c7f9311bccc89a00/plot_lle_digits.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,9 @@ def plot_embedding(X, title):
134134
"LTSA LLE embedding": LocallyLinearEmbedding(
135135
n_neighbors=n_neighbors, n_components=2, method="ltsa"
136136
),
137-
"MDS embedding": MDS(n_components=2, n_init=1, max_iter=120, n_jobs=2),
137+
"MDS embedding": MDS(
138+
n_components=2, n_init=1, max_iter=120, n_jobs=2, normalized_stress="auto"
139+
),
138140
"Random Trees embedding": make_pipeline(
139141
RandomTreesEmbedding(n_estimators=200, max_depth=5, random_state=0),
140142
TruncatedSVD(n_components=2),

dev/_downloads/c6ccb1a9c5f82321f082e9767a2706f3/plot_stack_predictors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ def load_ames_housing():
7272
"MoSold",
7373
]
7474

75-
X = X[features]
75+
X = X.loc[:, features]
7676
X, y = shuffle(X, y, random_state=0)
7777

78-
X = X[:600]
79-
y = y[:600]
78+
X = X.iloc[:600]
79+
y = y.iloc[:600]
8080
return X, np.log(y)
8181

8282

dev/_downloads/fcae36814d8e700024ca855a1eb87ca9/plot_faces_decomposition.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@
184184
},
185185
"outputs": [],
186186
"source": [
187-
"kmeans_estimator = cluster.MiniBatchKMeans(\n n_clusters=n_components,\n tol=1e-3,\n batch_size=20,\n max_iter=50,\n random_state=rng,\n)\nkmeans_estimator.fit(faces_centered)\nplot_gallery(\n \"Cluster centers - MiniBatchKMeans\",\n kmeans_estimator.cluster_centers_[:n_components],\n)"
187+
"kmeans_estimator = cluster.MiniBatchKMeans(\n n_clusters=n_components,\n tol=1e-3,\n batch_size=20,\n max_iter=50,\n random_state=rng,\n n_init=\"auto\",\n)\nkmeans_estimator.fit(faces_centered)\nplot_gallery(\n \"Cluster centers - MiniBatchKMeans\",\n kmeans_estimator.cluster_centers_[:n_components],\n)"
188188
]
189189
},
190190
{

dev/_downloads/scikit-learn-docs.zip

-28.8 KB
Binary file not shown.
-186 Bytes

0 commit comments

Comments
 (0)