8000 MAINT make plot_digits_denoising deterministic by fixing random state… · Veghit/scikit-learn@c1a2106 · GitHub
[go: up one dir, main page]

Skip to content

Commit c1a2106

Browse files
mdariiItay
authored andcommitted
MAINT make plot_digits_denoising deterministic by fixing random state (scikit-learn#26004)
1 parent 446209a commit c1a2106

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

examples/applications/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 D1D1
HistGradientBoostingRegressor(
218218
categorical_features=categorical_columns,
219+
random_state=42,
219220
),
220221
).set_output(transform="pandas")
221222

examples/applications/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)

0 commit comments

Comments
 (0)
0