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.
1 parent 3f9d33c commit 994cbe1Copy full SHA for 994cbe1
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