Skip to content

Commit 003836d

Browse files
Allow 1-D threshold binary predictions (#879)
1 parent a67832a commit 003836d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

autosklearn/metrics/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ def __call__(self, y_true, y_pred, sample_weight=None):
125125
raise ValueError("{0} format is not supported".format(y_type))
126126

127127
if y_type == "binary":
128-
y_pred = y_pred[:, 1]
128+
if y_pred.ndim > 1:
129+
y_pred = y_pred[:, 1]
129130
elif isinstance(y_pred, list):
130131
y_pred = np.vstack([p[:, -1] for p in y_pred]).T
131132

0 commit comments

Comments
 (0)