[MRG] BUG fix RidgeClassifierCV to accept custom score - #14848
Conversation
cf381c6 to
8ba98de
Compare
|
ping @amueller If time permits, please share your reviews |
|
@venkyyuvy please address @glemaitre reviews before asking for more. |
|
Sorry for that. I thought that I had addressed the reviews from @glemaitre. Please let me know, if I had misunderstood. |
|
Hi @agramfort, There is no additional response from @glemaitre, |
|
the error persists when |
True. I had raised another issue for this and am waiting for members to give me a thumbs up to start working on that. |
|
Could please review this PR? |
|
@venkyyuvy I made a PR there: venkyyuvy#3 |
Thanks a lot @glemaitre. |
glemaitre
left a comment
There was a problem hiding this comment.
LGTM.
@qinhanmin2014 could you have a look at it. This PR is only here to check that we can pass a scoring to RidgeClassificationCV. We are getting closer to what we want to do :)
|
Feel free to push a new description
…On Tue, 10 Dec 2019 at 09:16, Venkatachalam N ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In doc/whats_new/v0.23.rst
<#14848 (comment)>
:
> @@ -73,6 +73,11 @@ Changelog
`store_cv_values` is `True`.
:pr:`15652` by :user:`Jérôme Dockès <jeromedockes>`.
+- |Fix| Fixed a bug in :class:`linear_model.RidgeRegressionCV` to pass a
Shouldn't this be RidgeClassifierCV?
Also I had fixed a bug, which raises error when RidgeClassifierCV is fed
with classifier scoring and CV!=None
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#14848?email_source=notifications&email_token=ABY32P5IMBG3BSAQVLTFMXDQX5F5DA5CNFSM4ISHHMP2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCOTBDZI#pullrequestreview-329650661>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABY32P4VZ34LP6HKJWH35ALQX5F5DANCNFSM4ISHHMPQ>
.
--
Guillaume Lemaitre
Scikit-learn @ Inria Foundation
https://glemaitre.github.io/
|
|
ping @amueller (maybe :)) |
|
|
||
| @pytest.mark.parametrize("scoring", [None, "accuracy", _accuracy_callable]) | ||
| @pytest.mark.parametrize("cv", [None, KFold(5)]) | ||
| @pytest.mark.parametrize("filter_", [DENSE_FILTER, SPARSE_FILTER]) |
There was a problem hiding this comment.
I would test also with a dummy callable that return let's say 0.42 all the time and check that the score I obtain is actually 0.42 and that the C selected is the smallest one (strongest regularization). In case of tie between cv_scores you should always pick the most regularized model.
There was a problem hiding this comment.
Actually, tests are failing. We pick up the smallest alpha instead of the largest one.
There was a problem hiding this comment.
The reason is that we loop over the alphas in the order in the constructor.
Therefore, it will keep alphas[0] in all cases. If we want to apply your suggestion we need to change the behaviour of RidgeCV and RidgeClassifierCV
There was a problem hiding this comment.
We can address this in another PR then.
There was a problem hiding this comment.
Can I work this PR?
There was a problem hiding this comment.
I already open one there: #16029
But feel free to comment and contribute. I think that I found some other bugs.
|
@agramfort you can probably merge then :) |
|
thx @venkyyuvy and @glemaitre ! |
…14848) * handle_clf_ridgeGCV * included test case * undo_lambda_rm * crtd_commet * check_y * include_comp_proba * fix_format * added more comment for is_clf condtn * adding param is_clf * adding super * format fixes * init params * moving param 2 inint * using is_classifier * removing super * ENH do not allocate local arrays in Ridge*CV of store_cv_vales is False * add whats new * TST check multiple metrics for RidgeCV * linting * update whats new * missing doc when solving conflict * missing doc * style * correct whats new * fix * address agramfort comments * fix Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Fixes: #14672. Fixes #14856.
What does this implement/fix?
Added param
is_clfto_BaseRidgeCVfor identifying whether the problem is regression or classification.Changes target variable transformation in
.fit()based on input for cv becauseRidgeClassifierCVinternally does the transformation.I have included a test cases for both scenarios
cv == Noneandcv!=None.