Skip to content

Commit 97e4fa0

Browse files
committed
Pushing the docs to dev/ for branch: main, commit 2fbded2d11e4802ab9028f476560b6987b07f365
1 parent bef70b0 commit 97e4fa0

File tree

1,267 files changed

+4761
-4598
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,267 files changed

+4761
-4598
lines changed
Binary file not shown.

dev/_downloads/32173eb704d697c23dffbbf3fd74942a/plot_digits_denoising.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,14 @@ def plot_digits(X, title):
9898
# uses a radial basis function (RBF) kernel.
9999
from sklearn.decomposition import PCA, KernelPCA
100100

101-
pca = PCA(n_components=32)
101+
pca = PCA(n_components=32, random_state=42)
102102
kernel_pca = KernelPCA(
103-
n_components=400, kernel="rbf", gamma=1e-3, fit_inverse_transform=True, alpha=5e-3
103+
n_components=400,
104+
kernel="rbf",
105+
gamma=1e-3,
106+
fit_inverse_transform=True,
107+
alpha=5e-3,
108+
random_state=42,
104109
)
105110

106111
pca.fit(X_train_noisy)
Binary file not shown.

dev/_downloads/7012baed63b9a27f121bae611b8285c2/plot_cyclical_feature_engineering.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@
297297
},
298298
"outputs": [],
299299
"source": [
300-
"from sklearn.pipeline import make_pipeline\nfrom sklearn.preprocessing import OrdinalEncoder\nfrom sklearn.compose import ColumnTransformer\nfrom sklearn.ensemble import HistGradientBoostingRegressor\nfrom sklearn.model_selection import cross_validate\n\n\ncategorical_columns = [\n \"weather\",\n \"season\",\n \"holiday\",\n \"workingday\",\n]\ncategories = [\n [\"clear\", \"misty\", \"rain\"],\n [\"spring\", \"summer\", \"fall\", \"winter\"],\n [\"False\", \"True\"],\n [\"False\", \"True\"],\n]\nordinal_encoder = OrdinalEncoder(categories=categories)\n\n\ngbrt_pipeline = make_pipeline(\n ColumnTransformer(\n transformers=[\n (\"categorical\", ordinal_encoder, categorical_columns),\n ],\n remainder=\"passthrough\",\n # Use short feature names to make it easier to specify the categorical\n # variables in the HistGradientBoostingRegressor in the next\n # step of the pipeline.\n verbose_feature_names_out=False,\n ),\n HistGradientBoostingRegressor(\n categorical_features=categorical_columns,\n ),\n).set_output(transform=\"pandas\")"
300+
"from sklearn.pipeline import make_pipeline\nfrom sklearn.preprocessing import OrdinalEncoder\nfrom sklearn.compose import ColumnTransformer\nfrom sklearn.ensemble import HistGradientBoostingRegressor\nfrom sklearn.model_selection import cross_validate\n\n\ncategorical_columns = [\n \"weather\",\n \"season\",\n \"holiday\",\n \"workingday\",\n]\ncategories = [\n [\"clear\", \"misty\", \"rain\"],\n [\"spring\", \"summer\", \"fall\", \"winter\"],\n [\"False\", \"True\"],\n [\"False\", \"True\"],\n]\nordinal_encoder = OrdinalEncoder(categories=categories)\n\n\ngbrt_pipeline = make_pipeline(\n ColumnTransformer(\n transformers=[\n (\"categorical\", ordinal_encoder, categorical_columns),\n ],\n remainder=\"passthrough\",\n # Use short feature names to make it easier to specify the categorical\n # variables in the HistGradientBoostingRegressor in the next\n # step of the pipeline.\n verbose_feature_names_out=False,\n ),\n HistGradientBoostingRegressor(\n categorical_features=categorical_columns,\n random_state=42,\n ),\n).set_output(transform=\"pandas\")"
301301
]
302302
},
303303
{

dev/_downloads/9fcbbc59ab27a20d07e209a711ac4f50/plot_cyclical_feature_engineering.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@
216216
),
217217
HistGradientBoostingRegressor(
218218
categorical_features=categorical_columns,
219+
random_state=42,
219220
),
220221
).set_output(transform="pandas")
221222

dev/_downloads/f499e804840a40d11222872e84726eef/plot_digits_denoising.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
},
117117
"outputs": [],
118118
"source": [
119-
"from sklearn.decomposition import PCA, KernelPCA\n\npca = PCA(n_components=32)\nkernel_pca = KernelPCA(\n n_components=400, kernel=\"rbf\", gamma=1e-3, fit_inverse_transform=True, alpha=5e-3\n)\n\npca.fit(X_train_noisy)\n_ = kernel_pca.fit(X_train_noisy)"
119+
"from sklearn.decomposition import PCA, KernelPCA\n\npca = PCA(n_components=32, random_state=42)\nkernel_pca = KernelPCA(\n n_components=400,\n kernel=\"rbf\",\n gamma=1e-3,\n fit_inverse_transform=True,\n alpha=5e-3,\n random_state=42,\n)\n\npca.fit(X_train_noisy)\n_ = kernel_pca.fit(X_train_noisy)"
120120
]
121121
},
122122
{

dev/_downloads/scikit-learn-docs.zip

-9.07 KB
Binary file not shown.
-39 Bytes
16 Bytes
-25 Bytes

0 commit comments

Comments
 (0)