RidgeClassifierCV bug when using scoring
See original GitHub issuefrom sklearn.datasets import load_breast_cancer
from sklearn.linear_model import RidgeClassifierCV
X, y = load_breast_cancer(return_X_y=True)
RidgeClassifierCV(scoring='accuracy').fit(X, y)
errors because the fake estimator that’s constructed in RidgeGCV is a regressor and the predict
method returns the scores, not the predictions.
Also see #4667
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Scoring function for RidgeClassifierCV - python - Stack Overflow
As a hacky workaround to this, since you are using your own score function, I propose that you threshold the continuous values at...
Read more >sklearn.linear_model.RidgeClassifierCV
A string (see model evaluation documentation) or a scorer callable object / function with signature scorer(estimator, X, y) . cvint, cross-validation ...
Read more >RidgeClassifierCV — ibex latest documentation - Read the Docs
A string (see model evaluation documentation) or a scorer callable object / function with signature scorer(estimator, X, y) . cv : ...
Read more >Classification Example with Ridge Classifier in Python
The Ridge Classifier, based on Ridge regression method, converts the label data into [-1, 1] and solves the problem with regression method.
Read more >scikit-learn - linear_model.RidgeClassifierCV - 编程狮
RidgeClassifierCV (alphas=(0.1, 1.0, 10.0), fit_intercept=True, normalize=False, scoring=None, cv=None, class_weight=None) [source]. Ridge classifier with ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@venkyyuvy I think we should just change the handling in https://github.com/scikit-learn/scikit-learn/blob/1495f6924/sklearn/linear_model/ridge.py#L1459 and make sure we treat both regressors and classifier correctly
Hi Contributors, Thanks for your interest. I had raised a PR for this issue and waiting for reviews. Kindly check my PR above for more info.