-
Notifications
You must be signed in to change notification settings - Fork 222
Fix warnings from scikit-learn 1.8+ and introduce FixedPipeline #850
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
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.
Pull request overview
This pull request addresses warnings from scikit-learn 1.8+ by introducing a FixedPipeline class that is always considered fitted, eliminating FutureWarning messages for unfitted pipelines. The changes ensure that preprocessing pipelines that only apply fixed transformations (filtering, epoching, etc.) are properly marked as fitted.
Key Changes
- Introduced
FixedPipelineclass andmake_fixed_pipelinefunction that create pipelines marked as fitted via the__sklearn_is_fitted__method - Updated all FixedTransformer subclasses to properly call
super().__init__()and returnselffromfit()methods - Replaced
PipelinewithFixedPipelineandmake_pipelinewithmake_fixed_pipelinethroughout the preprocessing and paradigm code
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| moabb/datasets/preprocessing.py | Introduces FixedPipeline class and make_fixed_pipeline function; adds sklearn_is_fitted methods to ForkPipelines and FixedTransformer; ensures all FixedTransformer subclasses call super().init() |
| moabb/paradigms/base.py | Replaces Pipeline with FixedPipeline and make_pipeline with make_fixed_pipeline; updates imports to include the new FixedPipeline utilities |
| moabb/datasets/base.py | Replaces Pipeline with FixedPipeline in dataset processing pipeline creation and cache handling |
| docs/source/whats_new.rst | Documents the fix for scikit-learn warnings in the changelog |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Parameters | ||
| ---------- | ||
| *steps : list of estimators | ||
| List of (name, transform) tuples that are chained in the pipeline. |
Copilot
AI
Dec 9, 2025
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.
The parameter documentation is incorrect. The function uses _name_estimators(steps) which means it expects bare estimators, not tuples. The docstring should say:
*steps : list of estimators
List of estimators that are chained in the pipeline. These are automatically named.
This matches sklearn's make_pipeline behavior, which takes estimators directly rather than named tuples (unlike the Pipeline constructor).
| List of (name, transform) tuples that are chained in the pipeline. | |
| List of estimators that are chained in the pipeline. These are automatically named. |
|
Thanks!!! That message was terrible! It was flooding the console to the point that I could not see any other message and I had to revert to an older version. |
* V1.4.2 (#845) * fixing the release * pushing to including the .csv * pre-commit * v 1.4.2 * Fix `SetRawAnnotations` when no stim channel (#838) * First try to fix * Add test * [pre-commit.ci] auto fixes from pre-commit.com hooks * Whats new * enforce desired event ids when creating events from annotations --------- Signed-off-by: Pierre Guetschel <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Increase compatibility with Python 3.14 (#848) * Initial plan * Increase compatibility with Python 3.14 Co-authored-by: bruAristimunha <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: bruAristimunha <[email protected]> * Fix warnings from scikit-learn 1.8+ and introduce FixedPipeline (#850) * p * fixing number * Fix compatibility with scikit-learn 1.8 (#852) * fixing more colab issues * updating the utils * Enhance documentation and update design elements (#853) * more design details * more adjust * more adjusts * more updates * updating the readme * removing the roadmap * first round * more modification and almost done * including subject info * remove the video * more details * updating to colab * updating the citation * updating the __init__ * Macro release (#854) --------- Signed-off-by: Pierre Guetschel <[email protected]> Co-authored-by: Bru <[email protected]> Co-authored-by: Pierre Guetschel <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Copilot <[email protected]> Co-authored-by: bruAristimunha <[email protected]>
* Release 1.4.3 (#855) * V1.4.2 (#845) * fixing the release * pushing to including the .csv * pre-commit * v 1.4.2 * Fix `SetRawAnnotations` when no stim channel (#838) * First try to fix * Add test * [pre-commit.ci] auto fixes from pre-commit.com hooks * Whats new * enforce desired event ids when creating events from annotations --------- Signed-off-by: Pierre Guetschel <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Increase compatibility with Python 3.14 (#848) * Initial plan * Increase compatibility with Python 3.14 Co-authored-by: bruAristimunha <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: bruAristimunha <[email protected]> * Fix warnings from scikit-learn 1.8+ and introduce FixedPipeline (#850) * p * fixing number * Fix compatibility with scikit-learn 1.8 (#852) * fixing more colab issues * updating the utils * Enhance documentation and update design elements (#853) * more design details * more adjust * more adjusts * more updates * updating the readme * removing the roadmap * first round * more modification and almost done * including subject info * remove the video * more details * updating to colab * updating the citation * updating the __init__ * Macro release (#854) --------- Signed-off-by: Pierre Guetschel <[email protected]> Co-authored-by: Bru <[email protected]> Co-authored-by: Pierre Guetschel <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Copilot <[email protected]> Co-authored-by: bruAristimunha <[email protected]> * updating the md and yml * updating the DNS config * more documentation fix * checking links automatically * Update README.md Signed-off-by: Bru <[email protected]> * more fix within the links * fixing the url --------- Signed-off-by: Pierre Guetschel <[email protected]> Signed-off-by: Bru <[email protected]> Signed-off-by: Bru <[email protected]> Co-authored-by: Bruno Aristimunha <[email protected]> Co-authored-by: Pierre Guetschel <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Copilot <[email protected]>
Update the preprocessing logic to address warnings from the latest scikit-learn version. Introduce a FixedPipeline class to handle pipelines that do not require fitting, ensuring compatibility with future versions of scikit-learn. Adjust existing code to utilize FixedPipeline where appropriate.