8000 improve error message · thomasjpfan/scikit-learn@140287d · GitHub
[go: up one dir, main page]

Skip to content

Commit 140287d

Browse files
committed
improve error message
1 parent 759d1b4 commit 140287d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

sklearn/metrics/_plot/roc_curve.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ def plot_roc_curve(estimator, X, y, pos_label=None, sample_weight=None,
146146

147147
if y_pred.ndim != 1:
148148
if y_pred.shape[1] > 2:
149-
raise ValueError("Estimator solve a binary classification problem")
149+
raise ValueError("Estimator should solve a"
150+
"binary classification problem")
150151
y_pred = y_pred[:, 1]
151152
fpr, tpr, _ = roc_curve(y, y_pred, pos_label=pos_label,
152153
drop_intermediate=drop_intermediate)

sklearn/metrics/_plot/tests/test_plot_roc_curve.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def test_plot_roc_curve_error_non_binary(data):
2525
clf = DecisionTreeClassifier()
2626
clf.fit(X, y)
2727

28-
msg = "Estimator solve a binary classification problem"
28+
msg = "Estimator should solve a binary classification problem"
2929
with pytest.raises(ValueError, match=msg):
3030
plot_roc_curve(clf, X, y)
3131

0 commit comments

Comments
 (0)
0