Skip to content
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

Add Riemann Quantum Classifier #31

Merged
merged 34 commits into from
Feb 11, 2022
Merged

Add Riemann Quantum Classifier #31

merged 34 commits into from
Feb 11, 2022

Conversation

gcattan
Copy link
Collaborator

@gcattan gcattan commented Feb 4, 2022

This PR implements #23.
The helper classifier which is implemented here will be used for CVGridSearch.
A couple of tests were added to test_classification.py and required to refactorize some of the methods into a dataset/utils module.

(WIP: missing documentation of the dataset module, and error in the pipeline)

doc/api.rst Outdated Show resolved Hide resolved
nfilter : int (default: 1)
The number of filter for the xDawnFilter.
The number of components selected is 2 x nfilter.
dim_red : TransformerMixin (default: NaiveDimRed(is_even=True))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PCA seems a better default choice, because NaiveDimRed can easily loose discriminant features.

@@ -417,3 +422,192 @@ def predict(self, X):
"""
_, labels = self._predict(X)
return self._map_0_1_to_classes(labels)


class RiemannQuantumClassifier(BaseEstimator, ClassifierMixin,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure that the current name is adapted.
The method looks like a full pipeline with strong constraints (Xdawn, tangent space, dimension reduction), rather than a new generic classifier.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. I will try to find something more appropriate.

pyriemann_qiskit/classification.py Show resolved Hide resolved
Comment on lines 9 to 11
"""Return mne epochs with duration 1s.
Only visual left and right trials are selected.
Data are returned filtered.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you complete the description of the task of the signal, and add the link towards MNE dataset page?

@gcattan
Copy link
Collaborator Author

gcattan commented Feb 7, 2022

Thanks for the review!

There is still a problem with the pipeline, using python 3.8. To be honest I am not sure where it comes from.
Tests are ok on my local computer.

@gcattan
Copy link
Collaborator Author

gcattan commented Feb 7, 2022

Ok, I compared the package version with older builds and it seems that the scipy version changed 2 days ago.

@toncho11 FYI

@gcattan gcattan marked this pull request as ready for review February 7, 2022 20:27
@qbarthelemy qbarthelemy merged commit dc046fe into pyRiemann:main Feb 11, 2022
@qbarthelemy
Copy link
Member

Thx @gcattan !

@gcattan
Copy link
Collaborator Author

gcattan commented Feb 11, 2022

Thanks for the review :)

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.

2 participants