Repository navigation
[MRG + 1] Reject regression type targets for classifiers - #5084
vermouthmjl wants to merge 10 commits into
Conversation
There was a problem hiding this comment.
When y is centered (in a test for RandomizedLogisticRegression), [0,1] becomes [-0.5, 0.5], therefore is continuous.
This is a bit arbitrary... Maybe it's better to change that test.
There was a problem hiding this comment.
That seems like a bug in randomized logistic regression.
|
Looks good apart from my minor nitpicks. |
|
OK, I added a test for assert_non_regression_targets, and changed the RandomizedLogisticRegression test so that there is no need to treat the 2 float value targets. |
There was a problem hiding this comment.
The name assert_* makes it sound like a unit test utility function.
There was a problem hiding this comment.
I thought about is_non_regression_targets, but it is supposed to do nothing at all when it is non regression targets, and raise an exception otherwise. So returning a bool seemed a little superfluous.
There was a problem hiding this comment.
you could do check_non_regression_target? On second though, as it raises an exception, assert seems ok.
There was a problem hiding this comment.
check functions seem to raise exceptions too, specifically check_array. I like check_non_regression_target better than assert_non_regression_target, personally.
There was a problem hiding this comment.
OK. I changed that into check_non_regression_targets.
|
One concern is that https://github.com/vermouthmjl/scikit-learn/blob/type_of_target/sklearn/utils/multiclass.py#L328 |
|
The first one is only done when |
|
We could add an |
|
vermouthmjl : are you completing #4976 as well? |
|
What is the status here? Can you please rebase? |
|
It looks like it is good to go. @ogrisel any opinions? |
6a4d076 to
56d8c52
Compare
There was a problem hiding this comment.
Why is this commented function added in?
|
Hm I just realize we should have a common test for this. Could you please add one in |
|
@amueller I think I already did that by adding |
|
@vermouthmjl sorry, you're good. I was a bit sleep deprived. |
|
Is it clearer to move the |
I don't think a Mixin class should implement fit to do input checks without performing any actual data fitting and then expect the concrete classes to override it to do the actual data fitting. I find it simpler and more explicit to call input check functions explicitly in the fit method of the concrete class. |
|
Makes sense. LGTM as well (apart from inline comments). Maybe you can rebase and merge yourself (if this is important for the release)? |
…th two distinct values
0f513bd to
0413fd5
Compare
|
I rebased. @amueller |
0413fd5 to
d7bf5c7
Compare
|
squashed and merged as 85223b9. I think it will be good to have this in the RC. |
This PR solves #5060