-
Notifications
You must be signed in to change notification settings - Fork 22
Update to latest versions of sklearn and scipy #239
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
Conversation
75e03da
to
879057b
Compare
879057b
to
feb10b0
Compare
0a4af31
to
790eee3
Compare
* replacing `self._validate_data` with `validate_data` * Additional fixes * Fixing scikit-learn warnings * Fixing PCovR to work with 1D column vectors * Fixing examples * Changing shape of y in pcovr tests * Fixing PCovR to not mess with data shape --------- Co-authored-by: Christian Jorgensen <[email protected]>
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.
In general things look good -- I don't think we need to do the validation checks in the selector subclasses because they're taken care of in the superclass. I can approve once codecov passes with sufficient tests.
src/skmatter/_selection.py
Outdated
y : ignored | ||
|
||
Returns | ||
------- | ||
score : numpy.ndarray of (n_to_select_from_) | ||
:math:`\pi` importance for the given samples or features | ||
""" | ||
if y is not None: | ||
validate_data(self, X, y.ravel(), reset=False) |
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.
With the checks already present in the superclass, I do not think these validations are necessary.
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.
Yep. We need to keep the validation for X even though it's not necessary because scikit-learn now enforces that the shape of X passed for score()
must be consistent with the shape of X used in fit()
. The validation for y is not necessary and I have removed it.
src/skmatter/_selection.py
Outdated
if y is not None: | ||
validate_data(self, X, y.ravel(), reset=False) | ||
else: | ||
validate_data(self, X, reset=False) # present for API consistency |
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.
Same note as above. These matrices will already be validated in GreedySelector.
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.
Fixed - see above.
src/skmatter/_selection.py
Outdated
if y is not None: | ||
validate_data(self, X, y.ravel(), reset=False) | ||
else: | ||
validate_data(self, X, reset=False) |
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.
Same note as above. These matrices will already be validated in GreedySelector.
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.
Fixed - see above
src/skmatter/_selection.py
Outdated
if y is not None: | ||
validate_data(self, X, y.ravel(), reset=False) | ||
else: | ||
validate_data(self, X, reset=False) |
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.
Same note as above. These matrices will already be validated in GreedySelector.
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.
Fixed - see above
Co-authored-by: Rose K. Cersonsky <[email protected]>
Co-authored-by: Rose K. Cersonsky <[email protected]>
Fixes #237
Reopening of #238
Adding fixes for updates with scikit-learn and scipy. Scikit-learn's estimator checks will fail when
validate_data
is not used. These fixes will pass scikit-learn's estimator checks but are causing unit tests to fail.Contributor (creator of PR) checklist
For Reviewer
📚 Documentation preview 📚: https://scikit-matter--239.org.readthedocs.build/en/239/