-
Notifications
You must be signed in to change notification settings - Fork 1.3k
MAINT Replace stats.mode
calls with fixes._mode
#938
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
13 commits
Select commit
Hold shift + click to select a range
625c451
👽️ Replace `stats.mode` calls with `fixes`
hayesall 321a6d3
⬆️ Bump `SKLEARN_MIN_VERSION=1.1.3`
hayesall 6cfc3f1
⬆️ Bump `JOBLIB_MIN_VERSION=1.1.1`
hayesall 06dbbee
⬆️ Bump minimum numpy version in `py37_conda_defaults_openblas`
hayesall b466dbf
Merge branch 'master' into scipy-compat
hayesall 9db0b20
👽️ Pin flake8 to 5.0.4 in azure pipelines
hayesall ec50f5b
✨ Add alternative with imblearn.fixes._mode
hayesall cb7763f
📌 Un-bump sklearn and joblib
hayesall f1adb7f
🔥 Drop `-Werror::FutureWarning`
hayesall 18c2497
Merge remote-tracking branch 'origin/master' into pr/hayesall/938
glemaitre 26be29e
iter
glemaitre 14fcd35
iter
glemaitre 85f372d
iter
glemaitre 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
"""Compatibility fixes for older version of python, numpy, scipy, and | ||
scikit-learn. | ||
|
||
If you add content to this file, please give the version of the package at | ||
which the fix is no longer needed. | ||
""" | ||
|
||
import scipy | ||
import scipy.stats | ||
|
||
from sklearn.utils.fixes import parse_version | ||
|
||
sp_version = parse_version(scipy.__version__) | ||
|
||
|
||
# TODO: Remove when SciPy 1.9 is the minimum supported version | ||
def _mode(a, axis=0): | ||
if sp_version >= parse_version("1.9.0"): | ||
return scipy.stats.mode(a, axis=axis, keepdims=True) | ||
return scipy.stats.mode(a, axis=axis) |
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.
Uh oh!
There was an error while loading. Please reload this page.