-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
MAINT Parameters validation for covariance.ledoit_wolf #24870
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
Merged
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
1459031
validate param for ledoit_wolf
glevv 5a1e1d0
added to the test
glevv f22c551
revert commit and add note
glevv 451ff42
revert commit
glevv 4dec4e7
refactor ledoit_wolf logic
glevv fbf5277
Update _shrunk_covariance.py
glevv 082b8c7
Update _shrunk_covariance.py
glevv 8a8a17b
lint
glevv 8503a88
Update _shrunk_covariance.py
glevv dbfdf44
fix docs
glevv ff60a98
Merge branch 'scikit-learn:main' into ledoit-val
glevv c89c581
added to public tests
glevv 8d322e1
revert
glevv 2c6fa59
Merge branch 'main' into ledoit-val
glevv 1a34099
Update test_covariance.py
glevv 37c7acc
Update _shrunk_covariance.py
glevv a144812
Update test_covariance.py
glevv 020ba76
add validate params
glevv 82e59b9
added ledoit_wolf to public tests
glevv 4a895f4
added tests
glevv 8bd6de4
added default values
glevv 7f8bad6
Update test_covariance.py
glevv 1a787f6
linting
glevv 2a63033
removed context manager
glevv d06bdc5
Merge branch 'scikit-learn:main' into ledoit-val
glevv b01c33f
Update _shrunk_covariance.py
glevv 63191a6
added test
glevv 88e3e6b
Merge branch 'main' into ledoit-val
glevv 76f71fb
lint
glevv 8baa450
Update test_covariance.py
glevv 9d5dcb0
Update sklearn/covariance/tests/test_covariance.py
glevv da2476a
Update sklearn/covariance/tests/test_covariance.py
glevv 27039d3
Update test_covariance.py
glevv 16cf982
Merge branch 'main' into ledoit-val
glevv 4e061b4
Merge branch 'main' into ledoit-val
glevv 4a755ae
Merge branch 'main' into ledoit-val
glevv 801877e
Merge branch 'main' into ledoit-val
glevv 2664bb4
Merge branch 'main' into ledoit-val
glevv ba7841b
Merge branch 'main' into ledoit-val
glevv 769e28a
partial validation for class wrappers
jeremiedbb 35c8f1c
Merge remote-tracking branch 'upstream/main' into pr/glevv/24870
jeremiedbb 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
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.
We discussed this with @jeremiedbb in another PR. He suggested actually doing the double validation and adding the function to the list to run the common test.
Sorry for the back and forth. We did not anticipate all the issues. We start to settle on the way we want the validation to be done :)
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.
When I added function to public tests it raised this error
As I understand decorator
validate_params
adds attribute to the function, but in this case we do not use it, so it can't be accessed.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 mean we need to have:
and
Doing this on your PR, works for me.
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.
Then why not implement the first proposition: add param validation to the functions without rewriting them to use class inside?
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.
We tend to make the pattern "function calling class" consistent.
The other pattern is to make the class and function calling a private function. However, it makes the code difficult to read after trying a couple of examples.
Double validation becomes an issue when this is called within loops.