I'm getting a strange error while using 'roc_auc' scorer with GridSearchCV. The error does not happen when I use 'accuracy' instead. Looking at the stack trace it looks like y_score in roc_curve is being passed as None which results in this error from column_or_1d. I tested this out by calling column_or_1d directly with None as input and easily reproduced the error.
python3.7/site-packages/sklearn/metrics/ranking.py in roc_curve(y_true, y_score, pos_label, sample_weight, drop_intermediate)
616 """
617 fps, tps, thresholds = _binary_clf_curve(
--> 618 y_true, y_score, pos_label=pos_label, sample_weight=sample_weight)
619
620 # Attempt to drop thresholds corresponding to points in between and
python3.7/site-packages/sklearn/metrics/ranking.py in _binary_clf_curve(y_true, y_score, pos_label, sample_weight)
399 check_consistent_length(y_true, y_score, sample_weight)
400 y_true = column_or_1d(y_true)
--> 401 y_score = column_or_1d(y_score)
402 assert_all_finite(y_true)
403 assert_all_finite(y_score)
python3.7/site-packages/sklearn/utils/validation.py in column_or_1d(y, warn)
795 return np.ravel(y)
796
--> 797 raise ValueError("bad input shape {0}".format(shape))
798
799
ValueError: bad input shape ()
I further tested with data generated using the following and I get the exact same error:
from sklearn.datasets import make_classification
X_test, y_test = make_classification(100, 23)
I switched to using a pipeline that doesn't use the PipelineHelper and the errors went away so I'm assuming this is strictly and issue with PipelineHelper?
I'm getting a strange error while using
'roc_auc'
scorer withGridSearchCV
. The error does not happen when I use'accuracy'
instead. Looking at the stack trace it looks likey_score
inroc_curve
is being passed asNone
which results in this error fromcolumn_or_1d
. I tested this out by callingcolumn_or_1d
directly withNone
as input and easily reproduced the error.Some debugging info
I'm getting the error:
I further tested with data generated using the following and I get the exact same error:
I switched to using a pipeline that doesn't use the
PipelineHelper
and the errors went away so I'm assuming this is strictly and issue withPipelineHelper
?