Update for scikit-learn 1.8.0 and pandas 3.0.0 compatibility#106
Merged
larsoner merged 4 commits intomne-tools:masterfrom Feb 11, 2026
Merged
Update for scikit-learn 1.8.0 and pandas 3.0.0 compatibility#106larsoner merged 4 commits intomne-tools:masterfrom
larsoner merged 4 commits intomne-tools:masterfrom
Conversation
|
ping @larsoner and @agramfort |
larsoner
reviewed
Feb 10, 2026
| import joblib | ||
| from sklearn.pipeline import FeatureUnion | ||
| from sklearn.preprocessing import FunctionTransformer | ||
| from sklearn.utils.validation import validate_data |
Member
There was a problem hiding this comment.
This is going to lead to an import issue on any version of sklearn that doesn't have this, right? I think over in MNE-Python I figured out this meant 1.6+
Can you add a corresponding pin to >=1.6 to
Line 63 in 331ca47
Collaborator
Author
|
@larsoner |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
scikit-learn 1.8.0
https://scikit-learn.org/stable/whats_new/v1.8.html
DOC improve doc for
_check_n_featuresand_check_feature_namesand fix their usages scikit-learn/scikit-learn#31585In scikit-learn 1.8.0, the private
_check_inputmethod was removed fromFunctionTransformer. Instead,validate_datais now called directly insideFunctionTransformer.fit.To align with this change, this PR updates:
mne_features/feature_extraction.pyFeatureFunctionTransformer.fitso that it calls
validate_datadirectly, mirroring the behavior ofFunctionTransformer.fitin scikit-learn 1.8.0.This avoids reliance on removed private APIs and ensures forward compatibility.
Note: scikit-learn 1.8.0 was released for Python >= 3.11.
pandas 3.0.0
https://pandas.pydata.org/docs/dev/whatsnew/v3.0.0.html
In pandas 3.0.0, calling
X.valueson a string-typed column now returns apandas.arrays.StringArrayinstead of a NumPyndarray.As a result,
numpy.testing.assert_equalno longer works as expected and raises:To ensure correct and stable comparisons across pandas versions, this PR updates
the relevant tests in:
mne_features/tests/test_univariate.pySpecifically, occurrences of
X.valuesare replaced withX.to_list(), whichprovides a plain Python list and avoids ambiguity when comparing string data.