-
Notifications
You must be signed in to change notification settings - Fork 9
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
Added an example that uses datasets from MOABB and the RG+QuantumSVM pipeline #39
Added an example that uses datasets from MOABB and the RG+QuantumSVM pipeline #39
Conversation
…rain Invaders datasets. It classifies using a Quantum Classifier and Riemannian geometry.
…ithub.com/toncho11/pyRiemann-qiskit into add_classification_for_BrainInvaders_2012
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
examples/ERP/classify_P300_bi.py
Outdated
class Vectorizer(BaseEstimator, TransformerMixin): | ||
def __init__(self): | ||
pass | ||
|
||
def fit(self, X, y): | ||
"""fit.""" | ||
return self | ||
|
||
def transform(self, X): | ||
"""transform. """ | ||
return np.reshape(X, (X.shape[0], -1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we intend to reuse this, can you add it to utils.filtering
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need this since you changed your example?
examples/ERP/classify_P300_bi.py
Outdated
shots=None, #'None' forces classic SVM | ||
nfilter=2, #default 2 | ||
dim_red=PCA(n_components=10), #default 10, higher values render better performance with the SVM version used in qiskit | ||
#q_account_token="" #IBM Quantum TOKEN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you raise a defect for the q_account_token
, following your observations in our Skype conversation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow-up opened here: #40
examples/ERP/classify_P300_bi.py
Outdated
pipelines["Xdw+LDA"] = make_pipeline( | ||
Xdawn(nfilter=2, estimator="scm"), | ||
Vectorizer(), | ||
LDA(solver="lsqr", shrinkage="auto") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You do not have the same number of component in your feature vector, as compared with the two other pipelines. Is this intended?
examples/ERP/classify_P300_bi.py
Outdated
ax.set_ylabel("ROC AUC") | ||
ax.set_ylim(0.3, 1) | ||
|
||
fig.show() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you post on a comment here the resulting figure?
from pyriemann_qiskit.classification import QuantumClassifierWithDefaultRiemannianPipeline | ||
from sklearn.decomposition import PCA | ||
|
||
|
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
examples/ERP/classify_P300_bi.py
Outdated
It uses QuantumClassifierWithDefaultRiemannianPipeline. This pipeline uses | ||
Riemannian Geometry and Tangent Space to generate features and a quantum SVM | ||
classifier. It uses MOABB for the evaluation and compariosn with 2 other | ||
standard pipelines. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adapt here text according to our Skype conversation.
examples/ERP/classify_P300_bi.py
Outdated
# Here we provide some pipelines for comparison: | ||
|
||
# Standard SVM on raw data | ||
from sklearn import svm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this at the beginning.
The number of pipelines has been reduced to two. This way it will be more simple to compare results.
add `print(__doc__)` to example
pyriemann_qiskit/utils/filtering.py
Outdated
pass | ||
|
||
def fit(self, X, y): | ||
"""fit.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add descriptions for Parameters and Returns, for fit()
and transform()
?
pyriemann_qiskit/utils/filtering.py
Outdated
class Vectorizer(BaseEstimator, TransformerMixin): | ||
"""This is an auxiliary transformer that allows one to vectorize data | ||
structures in a pipeline For instance, in the case of an X with dimensions | ||
Nt x Nc x Ns, one might be interested in a new data structure with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use the standard names for dimensions: n_samples, n_features, n_channels, etc.
…ithub.com/toncho11/pyRiemann-qiskit into gc/add_classification_for_BrainInvaders_2012
Co-authored-by: Quentin Barthélemy <q.barthelemy@gmail.com>
…ithub.com/toncho11/pyRiemann-qiskit into add_classification_for_BrainInvaders_2012
Hi, I think everything is ready for this PR to be accepted. |
@sylvchev did you have a chance to review the last modification? |
Change the way `q_account_token` changed (updated in last PR)
@toncho11 thanks for taking care of this. Do you think we can reuse some elements of your presentation at |
I was wondering how can provides an estimate of the chance level for the bi2012 dataset. Is there something we can reuse from moabb @sylvchev ? |
The example visualizes and compares with two other "standard" pipelines.
It depends on the newest version of MOABB 0.4.6.