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

Improvement of NCH #255

Merged
merged 18 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions benchmarks/light_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
QuantumClassifierWithDefaultRiemannianPipeline,
QuantumMDMWithRiemannianPipeline,
)
from pyriemann_qiskit.classification import QuanticNCH
import warnings
import sys

Expand Down Expand Up @@ -102,6 +103,22 @@
LDA(solver="lsqr", shrinkage="auto"),
)

pipelines["NCH+MIN_HULL"] = make_pipeline(
XdawnCovariances(
nfilter=3,
# classes=[labels_dict["Target"]],
estimator="lwf",
xdawn_estimator="scm",
),
QuanticNCH(
n_hulls_per_class=1,
n_samples_per_hull=3,
n_jobs=12,
subsampling="min",
quantum=False,
),
)

##############################################################################
# Compute score
# --------------
Expand Down
2 changes: 1 addition & 1 deletion doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Utils functions are low level functions for the `classification` and `pipelines`

Utils
~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. _hyper_params_factory_api:
.. _utils_api:
.. currentmodule:: pyriemann_qiskit.utils.utils

.. autosummary::
Expand Down
16 changes: 9 additions & 7 deletions examples/ERP/classify_P300_nch.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,19 @@
# Modified from plot_classify_EEG_tangentspace.py of pyRiemann
# License: BSD (3-clause)

from pyriemann.estimation import XdawnCovariances
from sklearn.pipeline import make_pipeline
from matplotlib import pyplot as plt
import warnings
import seaborn as sns

from matplotlib import pyplot as plt
from moabb import set_log_level
from moabb.datasets import bi2013a
from moabb.evaluations import WithinSessionEvaluation
from moabb.paradigms import P300
from pyriemann_qiskit.classification import QuanticNCH
from pyriemann.classification import MDM
from pyriemann.estimation import XdawnCovariances
import seaborn as sns
from sklearn.pipeline import make_pipeline

from pyriemann_qiskit.classification import QuanticNCH

print(__doc__)

Expand Down Expand Up @@ -80,7 +82,7 @@
n_hulls_per_class=1,
n_samples_per_hull=3,
n_jobs=12,
hull_type="random-hull",
subsampling="random",
quantum=False,
),
)
Expand All @@ -97,7 +99,7 @@
n_hulls_per_class=1,
n_samples_per_hull=3,
n_jobs=12,
hull_type="min-hull",
subsampling="min",
quantum=False,
),
)
Expand Down
Loading
Loading