Skip to content
Open
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
2 changes: 1 addition & 1 deletion moabb/datasets/braininvaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def _bi_data_path( # noqa: C901
zip_ref = z.ZipFile(path_zip, "r")
zip_ref.extractall(path_folder)
os.makedirs(osp.join(directory, f"Session{i + 1}"))
shutil.copy_tree(path_zip.strip(".zip"), directory)
shutil.copytree(path_zip.strip(".zip"), directory)
shutil.rmtree(path_zip.strip(".zip"))

# filter the data regarding the experimental conditions
Expand Down
24 changes: 13 additions & 11 deletions moabb/tests/test_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,30 @@ def test_benchmark_strdataset(self):
pipelines=str(self.pp_dir),
evaluations=["WithinSession"],
include_datasets=[
"FakeDataset-imagery-10-2--60-60--120-120--lefthand-righthand--c3-cz-c4",
"FakeDataset-p300-10-2--60-60--120-120--target-nontarget--c3-cz-c4",
"FakeDataset-ssvep-10-2--60-60--120-120--13-15--c3-cz-c4",
"FakeDataset-cvep-10-2--60-60--120-120--10-00--c3-cz-c4",
"FakeDataset-imagery-2-2--60-60--120-120--lefthand-righthand--c3-cz-c4",
"FakeDataset-p300-2-2--60-60--120-120--target-nontarget--c3-cz-c4",
"FakeDataset-ssvep-2-2--60-60--120-120--13-15--c3-cz-c4",
"FakeDataset-cvep-2-2--60-60--120-120--10-00--c3-cz-c4",
],
overwrite=True,
)
assert len(res) == 80
assert len(res) == 24

def test_benchmark_objdataset(self):
res = benchmark(
pipelines=str(self.pp_dir),
evaluations=["WithinSession"],
include_datasets=[
FakeDataset(["left_hand", "right_hand"], paradigm="imagery"),
FakeDataset(["Target", "NonTarget"], paradigm="p300"),
FakeDataset(["13", "15"], paradigm="ssvep"),
FakeDataset(["1.0", "0.0"], paradigm="cvep"),
FakeDataset(
["left_hand", "right_hand"], paradigm="imagery", n_subjects=2
),
FakeDataset(["Target", "NonTarget"], paradigm="p300", n_subjects=2),
FakeDataset(["13", "15"], paradigm="ssvep", n_subjects=2),
FakeDataset(["1.0", "0.0"], paradigm="cvep", n_subjects=2),
],
overwrite=True,
)
assert len(res) == 80
assert len(res) == 24

def test_nodataset(self):
with pytest.raises(ValueError):
Expand All @@ -61,7 +63,7 @@ def test_selectparadigm(self):
paradigms=["FakeImageryParadigm"],
overwrite=True,
)
assert len(res) == 40
assert len(res) == 16

def test_include_exclude(self):
with pytest.raises(AttributeError):
Expand Down
31 changes: 31 additions & 0 deletions moabb/tests/test_pipelines/CSP_SVM_grid.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: CSP + SVM Grid

paradigms:
- FakeImageryParadigm

pipeline:
- name: Covariances
from: pyriemann.estimation
parameters:
estimator: oas

- name: CSP
from: pyriemann.spatialfilters
parameters:
nfilter: 6

- name: SVC
from: sklearn.svm
parameters:
kernel: "linear"

param_grid:
csp__nfilter:
- 2
- 4
- 6
svc__C:
- 1
svc__kernel:
- "rbf"
- "linear"
11 changes: 11 additions & 0 deletions moabb/tests/test_pipelines/WTRCSP.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from pyriemann.estimation import Covariances
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
from sklearn.pipeline import make_pipeline

from moabb.pipelines.csp import TRCSP


pipe = make_pipeline(Covariances("scm"), TRCSP(nfilter=6), LinearDiscriminantAnalysis())

# this is what will be loaded
PIPELINE = {"name": "TRCSP + LDA", "paradigms": ["FakeImageryParadigm"], "pipeline": pipe}
14 changes: 14 additions & 0 deletions moabb/tests/test_pipelines/XdawnCov_MDM.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: XdawnCovariances + MDM

paradigms:
- FakeP300Paradigm

pipeline:
- name: XdawnCovariances
from: pyriemann.estimation
parameters:
estimator: oas
xdawn_estimator: scm

- name: MDM
from: pyriemann.classification
Loading