You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You get the exception: ValueError: continuous format is not supported with the stacktrace:
File "E:/myfolder/cv_issue.py", line 7, in classifier.fit(x, y)
File "E:\Anaconda2\lib\site-packages\sklearn\linear_model\ridge.py", line 1258, in fit
_BaseRidgeCV.fit(self, X, Y, sample_weight=sample_weight)
File "E:\Anaconda2\lib\site-packages\sklearn\linear_model\ridge.py", line 1022, in fit
estimator.fit(X, y, sample_weight=sample_weight)
File "E:\Anaconda2\lib\site-packages\sklearn\linear_model\ridge.py", line 965, in fit
for i in range(len(self.alphas))]
File "E:\Anaconda2\lib\site-packages\sklearn\metrics\scorer.py", line 159, in call
raise ValueError("{0} format is not supported".format(y_type))
ValueError: continuous format is not supported
But, obviously, I provided a binary output so I don't expect such error here. And if you replace RidgeClassifierCV(scoring='roc_auc') with a RidgeClassifierCV(scoring='roc_auc', cv=2), the code runs fine.
Hi, it seems that the values being passed to the scorer in here are y and cv_values[:,i] are passed as y_true and y_score for roc_auc_score, but in the scorer, _ThresholdScorer takes arguments X and y which now correspond to y_true and y_score in your case are
Thus the check of y_type is raising an error of continuous type. I am not sure if this is the expected behavior in here since Threshold scorer was designed with this intent. Sorry can't be of much help here.
If you run the following code:
You get the exception: ValueError: continuous format is not supported with the stacktrace:
But, obviously, I provided a binary output so I don't expect such error here. And if you replace
RidgeClassifierCV(scoring='roc_auc')
with aRidgeClassifierCV(scoring='roc_auc', cv=2)
, the code runs fine.My versions:
The text was updated successfully, but these errors were encountered: