Skip to content

WIP: Viz for spatial filters #13332

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

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open

WIP: Viz for spatial filters #13332

wants to merge 27 commits into from

Conversation

Genuster
Copy link
Contributor

@Genuster Genuster commented Jul 18, 2025

What does this implement/fix?

Adds SpatialFilter container for visualisation of filters, patterns and eigenvalues of GED-based algorithms (CSP, SPoC, SSD, XdawnTransformer) and other linear models (LinearModel).

  • implement plot_filters, plot_patterns, plot_scree
  • make possible to plot inverse_transform'ed filters/patterns in case of pipeline (as get_coef does)
    • make get_coef work with arbitrary step in the pipeline (not only the last LinearModel)
  • cover tests
  • replace CSP's plots with internal functions

@wmvanvliet
Copy link
Contributor

I'm all for adding nice visualizations for filters/patterns. Suggestion: would a MixedIn pattern make sense here instead of the class you have now?

@Genuster
Copy link
Contributor Author

Cheers @wmvanvliet!

My original thought was to make it usable with external spatial filters (PyRiemann transformers, for example).
I also realize now if the relevant transformer is in the middle of the pipeline and I want visualize its filters/patterns after inverse-transform, it would make sense to use a plain function that would instantiate the Viz class instead of adding it as a method to GED/LinearModel.
If I go with Mixin this case would be problematic, as far as I can tell.

Does that make sense? If you have an idea how we can work around it with Mixin, I'd be glad to hear

@Genuster Genuster marked this pull request as ready for review July 30, 2025 08:16
@Genuster Genuster requested a review from larsoner as a code owner July 30, 2025 08:16
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