8000 DOC Add random_state to all classifiers in plot_classifier_comparison… · REDVM/scikit-learn@8461c90 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8461c90

Browse files
TamaraAtanasoskaAnnaWey
autho 8000 red andcommitted
DOC Add random_state to all classifiers in plot_classifier_comparison.py (scikit-learn#26968)
Co-authored-by: AnnaWey <annawey@mail.de>
1 parent 1ef88d1 commit 8461c90

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

examples/classification/plot_classifier_comparison.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,15 @@
5858

5959
classifiers = [
6060
KNeighborsClassifier(3),
61-
SVC(kernel="linear", C=0.025),
62-
SVC(gamma=2, C=1),
63-
GaussianProcessClassifier(1.0 * RBF(1.0)),
64-
DecisionTreeClassifier(max_depth=5),
65-
RandomForestClassifier(max_depth=5, n_estimators=10, max_features=1),
66-
MLPClassifier(alpha=1, max_iter=1000),
67-
AdaBoostClassifier(),
61+
SVC(kernel="linear", C=0.025, random_state=42),
62+
SVC(gamma=2, C=1, random_state=42),
63+
GaussianProcessClassifier(1.0 * RBF(1.0), random_state=42),
64+
DecisionTreeClassifier(max_depth=5, random_state=42),
65+
RandomForestClassifier(
66+
max_depth=5, n_estimators=10, max_features=1, random_state=42
67+
),
68+
MLPClassifier(alpha=1, max_iter=1000, random_state=42),
69+
AdaBoostClassifier(random_state=42),
6870
GaussianNB(),
6971
QuadraticDiscriminantAnalysis(),
7072
]

0 commit comments

Comments
 (0)
0