Skip to content

Commit

Permalink
scikit-learn#5782 added test case for check_classification_targets()
Browse files Browse the repository at this point in the history
  • Loading branch information
varunkumar-dev committed Nov 10, 2015
1 parent 299c275 commit bc3c3db
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sklearn/tests/test_multiclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from sklearn.multiclass import OneVsRestClassifier
from sklearn.multiclass import OneVsOneClassifier
from sklearn.multiclass import OutputCodeClassifier
from sklearn.utils.multiclass import check_classification_targets

from sklearn.metrics import precision_score
from sklearn.metrics import recall_score
Expand Down Expand Up @@ -48,6 +49,12 @@ def test_ovr_exceptions():
np.array([[1.5, 2.4], [3.1, 0.8]]))


def test_check_classification_targets():
# Test that check_classification_target return correct type. #5782
y = np.array([0.0, 1.1, 2.0, 3.0])
assert_raises(ValueError, check_classification_targets, y)


def test_ovr_fit_predict():
# A classifier which implements decision_function.
ovr = OneVsRestClassifier(LinearSVC(random_state=0))
Expand Down

0 comments on commit bc3c3db

Please sign in to comment.