-
-
Notifications
You must be signed in to change notification settings - Fork 26.5k
FIX Remove warnings when fitting a dataframe #21578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jjerphan
merged 22 commits into
scikit-learn:main
from
thomasjpfan:remove_warning_random_forest_classifier
Nov 29, 2021
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
3ed49d5
FIX Removes double validation in fit
thomasjpfan 7021d0c
DOC Adds whats new
thomasjpfan 4b3d2f5
DOC Adds pr number
thomasjpfan 7fd4f65
Merge remote-tracking branch 'upstream/main' into remove_warning_rand…
thomasjpfan d9ca88a
CLN Address comments
thomasjpfan a449a64
Merge remote-tracking branch 'upstream/main' into remove_warning_rand…
thomasjpfan 45ed3ad
DOC Adds comment about CSR format for prediction
thomasjpfan 27027a0
TST Updates common test to check every estimator that predicts during…
thomasjpfan a13f7ee
DOC Update whats new
thomasjpfan cde9373
Merge remote-tracking branch 'upstream/main' into remove_warning_rand…
thomasjpfan 29aa492
ENH Use tocsr
thomasjpfan 5c22dec
BUG Fixes bug
thomasjpfan fbf7006
Trigger CI
ogrisel c74fec0
Merge remote-tracking branch 'upstream/main' into remove_warning_rand…
thomasjpfan d0a5c4c
CLN Address comments
thomasjpfan 4e3e8e8
Merge remote-tracking branch 'upstream/main' into remove_warning_rand…
thomasjpfan 3c1d57f
TST Fixes test (Will fail now on CI)
thomasjpfan 5a22b70
FIX Fixes issue same issue with MLP
thomasjpfan 8cea8d8
XFAIL the MLP case
thomasjpfan 5d323ac
REV Enable the other tests
thomasjpfan 0849124
Merge remote-tracking branch 'upstream/main' into remove_warning_rand…
thomasjpfan fab1268
DOC Fix syntax error in whats_new
thomasjpfan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't a cleaner API be like
self.predict(X, validate_input=False), orself.validate_input(predict=False).predict(X)?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think introducing a public arg for that is cleaner. I find it clean that we use a private function internally and expose a public function that does extra validation.
I don't get the
predict=Falsearg, could explain more what you have in mind ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are other reasons why a public, or a developer API, would be nice to have when it comes to [skipping] validation: #16653 (comment)
The
predict=Falsewould kinda set a flag in the estimator to skip the validation in a certain method.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think adding more state to the estimator after
__init__is outside the scope of this PR, but we can use this PR as a motivation to do it. It would kind of be like "inference mode".I think it would be very nice to have this type of kwarg everywhere. It would be similar to the
check_finiteflag in SciPy. (Every year I see the "Scikit-learn is slow during prediction" and it comes down to the validation we do.)In both cases, I do not think we should change public API with a bug fix PR.