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

Skip to content

Commit 2fbded2

Browse files
authored
MAINT make plot_digits_denoising deterministic by fixing random state (#26004)
1 parent 7df7062 commit 2fbded2

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

examples/applications/plot_cyclical_feature_engineering.py

+1
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

examples/applications/plot_digits_denoising.py

+7-2
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