Fix sklearn v1.3 Import for MissingValues #998
Closed
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.
Fixes #995
Fixes #996
Closes #997
What does this implement/fix? Explain your changes.
This PR fixes the import of
sklearn.utils._param_validation._MissingValuesin version 1.3 ofsklearn. The underscore has been removed; so from version 1.3 it issklearn.utils._param_validation.MissingValues(see scikit-learn/scikit-learn#26774). Following the current logic inimblearn.utils._param_validation, the version ofsklearnis checked and the import handled based on the installed version. Which is much better than simply removing the import as suggested by #997.Any other comments?
#987 suggested to set the minimum version of
sklearnto 1.2.1. I agree with the suggestion. It seems that by implementing said PR, only the above mentioned import needs to be handled differently based on the installed version ofsklearn, i.e., either 1.2 or 1.3.