Process function crashes expecting a classifier when using MDM from pyRiemann
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()
)
`
@BRomans, can you share some minimal code to reproduce the bug, with the versions of python, moabb and pyriemann you are using?
and version of sklearn. This could be an issue with cross validation with latest versions of sklearn.
Hi, here you are a very basic example taken from MOABB tutorials in which I added the MDM() classifier.
scikit-learn == 1.6.1 pyriemann == 0.7 Python 3.10.8
Moabb depends on sklearn <1.6
Can you downgrade your version of sklearn ?
@gcattan is right: if you use moabb with the correct version of the dependencies, there is no error.
@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.
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.