[MRG] Input validation refactoring#3443
Conversation
|
Hopefully more readable and consistent input checking. Also fixed some corner cases. |
sklearn/utils/validation.py
Outdated
sklearn/utils/validation.py
Outdated
There was a problem hiding this comment.
It assumes that you a .data which is not the case for each sparse matrix.
There was a problem hiding this comment.
that is true. The tests seem not to be so great ^^ we need to add a test for that.
sklearn/utils/validation.py
Outdated
There was a problem hiding this comment.
I think that here I would use the 'asformat' method of sparse matrices.
There was a problem hiding this comment.
ahh, I have been looking and not finding this method.
|
Does dense data always allowed? |
|
Yes, currently dense data is always allowed. Do we have an application where this is not the case? If we do at some point, we could later add a flag? |
|
thanks for the helpful reviews guys :) |
|
I see that this has switched to MRG, but the TODO still lists tests. What's the status on that? |
There was a problem hiding this comment.
Can you remove deprecated stuff?
There was a problem hiding this comment.
Not in this PR, but in the next PR which will touch all files.
sklearn/utils/validation.py
Outdated
There was a problem hiding this comment.
order : 'F', 'C' or None (default=None)
|
Except for the cosmetic comment, 👍 |
There was a problem hiding this comment.
Hum, that change is really surprising for me: I would read the 2 lines (the one removed and the one added) as doing very different things. It's probably just a question of choice of names on the arguments.
There was a problem hiding this comment.
that is because the previous behavior was surprising ;)
|
+1 for merging this PR as it is and deal with further refactoring in a separate PR. |
|
+1 |
[MRG] Input validation refactoring
|
Merged from the airport! Awesome work! Go Go team! |
|
err... I just squashed, rebased and merge... hum.... Let's see what'll happen now. |
|
Oh I didn't push. all is good. |
Refactor input validation to make it more consistent.
Todo