Skip to content

Process function crashes expecting a classifier when using MDM from pyRiemann #815

Closed

Description

@BRomans

I am evaluating the sota pipelines for P300 on the MOABB results page.
However, the MDM step returns the following error

ValueError: Pipeline should either be a classifier to be used with response_method=predict_proba or the response_method should be 'predict'. Got a regressor with response_method=predict_proba instead.

Am I doing something wrong or did something break with scikit / pyriemann updates?

`
pipelines["XdwCov+TS+SVM"] = make_pipeline(
XdawnCovariances(nfilter=2, classes=[labels_dict["Target"]], estimator="oas", xdawn_estimator="scm"),
TangentSpace(),
StandardScaler(),
SVC(C=1, kernel="linear", probability=True)
)

pipelines["Xdw+LDA"] = make_pipeline(
    Xdawn(nfilter=2, estimator="oas"),
    Vectorizer(),
    LDA(solver="lsqr", shrinkage="auto"),
)

pipelines["XdwCov+MDM"] = make_pipeline(
    XdawnCovariances(nfilter=2, classes=[labels_dict["Target"]], estimator="oas", xdawn_estimator="scm"),
    MDM()
)

`

Activity

  1. qbarthelemy commented on Sep 10, 2025

    @qbarthelemy
    Contributor

    @BRomans, can you share some minimal code to reproduce the bug, with the versions of python, moabb and pyriemann you are using?

  2. gcattan commented on Sep 10, 2025

    @gcattan
    Collaborator

    and version of sklearn. This could be an issue with cross validation with latest versions of sklearn.

  3. BRomans commented on Sep 18, 2025

    @BRomans
    CollaboratorAuthor

    Hi, here you are a very basic example taken from MOABB tutorials in which I added the MDM() classifier.

    moabb_test.py

    scikit-learn == 1.6.1
    pyriemann == 0.7
    Python 3.10.8

  4. gcattan commented on Sep 18, 2025

    @gcattan
    Collaborator

    Moabb depends on sklearn <1.6

    Can you downgrade your version of sklearn ?

  5. qbarthelemy commented on Sep 18, 2025

    @qbarthelemy
    Contributor

    @gcattan is right: if you use moabb with the correct version of the dependencies, there is no error.

  6. qbarthelemy commented on Sep 19, 2025

    @qbarthelemy
    Contributor

    @BRomans : if you can't downgrade scikit-learn, using pyriemann==0.9 with scikit-learn == 1.6.1 is OK,
    because the MRO issue was fixed in pyriemann 0.8.

  7. BRomans commented on Sep 26, 2025

    @BRomans
    CollaboratorAuthor

    Can confirm it works, however I had to force -install some stuff because there were multiple clashes with MOABB requirements and NumPy. For now it's sufficient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions