8000 FIX AdaBoost ZeroDivisionError in proba #7501 - tests corrected · scikit-learn/scikit-learn@42f478f · GitHub
[go: up one dir, main page]

Skip to content

Commit 42f478f

Browse files
author
Dominik Krzeminski
committed
FIX AdaBoost ZeroDivisionError in proba #7501 - tests corrected
1 parent 1e083dd commit 42f478f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sklearn/ensemble/tests/test_weight_boosting.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,13 @@ def predict_proba(self, X):
7373
assert_array_equal(np.argmin(samme_proba, axis=1), [2, 0, 0, 2])
7474
assert_array_equal(np.argmax(samme_proba, axis=1), [0, 1, 1, 1])
7575

76+
7677
def test_oneclass_proba():
7778
# Test `predict_proba` robustness for one class label input.
78-
y_t = np.ones((X.shape[0],))
79+
y_t = np.ones((len(X),))
7980
clf = AdaBoostClassifier().fit(X, y_t)
80-
assert_array_equal(clf.predict_proba(X), np.ones((X.shape[0],1)))
81+
assert_array_equal(clf.predict_proba(X), np.ones((X.shape[0], 1)))
82+
8183

8284
def test_classification_toy():
8385
# Check classification on a toy dataset.

0 commit comments

Comments
 (0)
0