Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents cda140e + 994cbe1 commit 7e2453aCopy full SHA for 7e2453a
sklearn/ensemble/tests/test_forest.py
@@ -980,11 +980,12 @@ def test_warm_start_oob():
980
yield check_warm_start_oob, name
981
982
983
-def test_dtype_convert():
984
- classifier = RandomForestClassifier()
985
- CLASSES = 15
986
- X = np.eye(CLASSES)
987
- y = [ch for ch in 'ABCDEFGHIJKLMNOPQRSTU'[:CLASSES]]
+def test_dtype_convert(n_classes=15):
+ classifier = RandomForestClassifier(random_state=0, bootstrap=False)
+
+ X = np.eye(n_classes)
+ y = [ch for ch in 'ABCDEFGHIJKLMNOPQRSTU'[:n_classes]]
988
989
result = classifier.fit(X, y).predict(X)
990
+ assert_array_equal(classifier.classes_, y)
991
assert_array_equal(result, y)
0 commit comments