question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RidgeClassifierCV bug when using scoring

See original GitHub issue
from 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:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
amuellercommented, Aug 24, 2019

@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

0reactions
venkyyuvycommented, Jan 7, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found