Skip to content

Conversation

@bruAristimunha
Copy link
Collaborator

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.

Copy link
Contributor

Copilot AI left a 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 FixedPipeline class and make_fixed_pipeline function that create pipelines marked as fitted via the __sklearn_is_fitted__ method
  • Updated all FixedTransformer subclasses to properly call super().__init__() and return self from fit() methods
  • Replaced Pipeline with FixedPipeline and make_pipeline with make_fixed_pipeline throughout 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.
Copy link

Copilot AI Dec 9, 2025

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).

Suggested change
List of (name, transform) tuples that are chained in the pipeline.
List of estimators that are chained in the pipeline. These are automatically named.

Copilot uses AI. Check for mistakes.
@bruAristimunha bruAristimunha merged commit a3e6db4 into develop Dec 9, 2025
19 checks passed
@bruAristimunha bruAristimunha deleted the fixing-warning branch December 9, 2025 21:10
@toncho11
Copy link
Contributor

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.

bruaris added a commit that referenced this pull request Dec 13, 2025
* 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]>
bruAristimunha added a commit that referenced this pull request Dec 14, 2025
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants