Note
Go to the end to download the full example code.
Select Electrodes and Resampling#
Within paradigm, it is possible to restrict analysis only to a subset of electrodes and to resample to a specific sampling rate. There is also a utility function to select common electrodes shared between datasets. This tutorial demonstrates how to use this functionality.
# Authors: Sylvain Chevallier <sylvain.chevallier@uvsq.fr>
#
# License: BSD (3-clause)
import matplotlib.pyplot as plt
from mne.decoding import CSP
from pyriemann.estimation import Covariances
from pyriemann.tangentspace import TangentSpace
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis as LDA
from sklearn.linear_model import LogisticRegression as LR
from sklearn.pipeline import make_pipeline
import moabb.analysis.plotting as moabb_plt
from moabb.analysis.chance_level import chance_by_chance
from moabb.datasets import BNCI2014_001, Zhou2016
from moabb.datasets.utils import find_intersecting_channels
from moabb.evaluations import WithinSessionEvaluation
from moabb.paradigms import LeftRightImagery
Datasets#
Load 2 subjects of BNCI 2014-004 and Zhou2016 datasets, with 2 sessions each
subj = [1, 2]
datasets = [Zhou2016(), BNCI2014_001()]
for d in datasets:
d.subject_list = subj
Paradigm#
Restrict further analysis to specified channels, here C3, C4, and Cz. Also, use a specific resampling. In this example, all datasets are set to 200 Hz.
paradigm = LeftRightImagery(channels=["C3", "C4", "Cz"], resample=200.0)
Evaluation#
The evaluation is conducted on with CSP+LDA, only on the 3 electrodes, with a sampling rate of 200 Hz.
evaluation = WithinSessionEvaluation(paradigm=paradigm, datasets=datasets)
csp_lda = make_pipeline(CSP(n_components=2), LDA())
ts_lr = make_pipeline(
Covariances(estimator="oas"), TangentSpace(metric="riemann"), LR(C=1.0)
)
results = evaluation.process({"csp+lda": csp_lda, "ts+lr": ts_lr})
print(results.head())
Extracting EDF parameters from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-0/eeg/sub-1_ses-0_task-imagery_run-0_eeg.edf...
Setting channel info structure...
Creating raw.info structure...
Reading channel info from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-0/eeg/sub-1_ses-0_task-imagery_run-0_channels.tsv.
Reading electrode coords from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-0/eeg/sub-1_ses-0_space-CapTrak_electrodes.tsv.
Not fully anonymizing info - keeping hand, his_id, sex of subject_info
Reading 0 ... 305249 = 0.000 ... 1220.996 secs...
Extracting EDF parameters from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-0/eeg/sub-1_ses-0_task-imagery_run-1_eeg.edf...
Setting channel info structure...
Creating raw.info structure...
Reading channel info from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-0/eeg/sub-1_ses-0_task-imagery_run-1_channels.tsv.
Reading electrode coords from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-0/eeg/sub-1_ses-0_space-CapTrak_electrodes.tsv.
Not fully anonymizing info - keeping hand, his_id, sex of subject_info
Reading 0 ... 430499 = 0.000 ... 1721.996 secs...
Extracting EDF parameters from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-1/eeg/sub-1_ses-1_task-imagery_run-0_eeg.edf...
Setting channel info structure...
Creating raw.info structure...
Reading channel info from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-1/eeg/sub-1_ses-1_task-imagery_run-0_channels.tsv.
Reading electrode coords from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-1/eeg/sub-1_ses-1_space-CapTrak_electrodes.tsv.
Not fully anonymizing info - keeping hand, his_id, sex of subject_info
Reading 0 ... 252749 = 0.000 ... 1010.996 secs...
Extracting EDF parameters from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-1/eeg/sub-1_ses-1_task-imagery_run-1_eeg.edf...
Setting channel info structure...
Creating raw.info structure...
Reading channel info from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-1/eeg/sub-1_ses-1_task-imagery_run-1_channels.tsv.
Reading electrode coords from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-1/eeg/sub-1_ses-1_space-CapTrak_electrodes.tsv.
Not fully anonymizing info - keeping hand, his_id, sex of subject_info
Reading 0 ... 296749 = 0.000 ... 1186.996 secs...
Extracting EDF parameters from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-2/eeg/sub-1_ses-2_task-imagery_run-0_eeg.edf...
Setting channel info structure...
Creating raw.info structure...
Reading channel info from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-2/eeg/sub-1_ses-2_task-imagery_run-0_channels.tsv.
Reading electrode coords from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-2/eeg/sub-1_ses-2_space-CapTrak_electrodes.tsv.
Not fully anonymizing info - keeping hand, his_id, sex of subject_info
Reading 0 ... 233249 = 0.000 ... 932.996 secs...
Extracting EDF parameters from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-2/eeg/sub-1_ses-2_task-imagery_run-1_eeg.edf...
Setting channel info structure...
Creating raw.info structure...
Reading channel info from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-2/eeg/sub-1_ses-2_task-imagery_run-1_channels.tsv.
Reading electrode coords from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-2/eeg/sub-1_ses-2_space-CapTrak_electrodes.tsv.
Not fully anonymizing info - keeping hand, his_id, sex of subject_info
Reading 0 ... 226249 = 0.000 ... 904.996 secs...
Extracting EDF parameters from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-0/eeg/sub-2_ses-0_task-imagery_run-0_eeg.edf...
Setting channel info structure...
Creating raw.info structure...
Reading channel info from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-0/eeg/sub-2_ses-0_task-imagery_run-0_channels.tsv.
Reading electrode coords from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-0/eeg/sub-2_ses-0_space-CapTrak_electrodes.tsv.
Not fully anonymizing info - keeping hand, his_id, sex of subject_info
Reading 0 ... 227749 = 0.000 ... 910.996 secs...
Extracting EDF parameters from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-0/eeg/sub-2_ses-0_task-imagery_run-1_eeg.edf...
Setting channel info structure...
Creating raw.info structure...
Reading channel info from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-0/eeg/sub-2_ses-0_task-imagery_run-1_channels.tsv.
Reading electrode coords from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-0/eeg/sub-2_ses-0_space-CapTrak_electrodes.tsv.
Not fully anonymizing info - keeping hand, his_id, sex of subject_info
Reading 0 ... 216249 = 0.000 ... 864.996 secs...
Extracting EDF parameters from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-1/eeg/sub-2_ses-1_task-imagery_run-0_eeg.edf...
Setting channel info structure...
Creating raw.info structure...
Reading channel info from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-1/eeg/sub-2_ses-1_task-imagery_run-0_channels.tsv.
Reading electrode coords from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-1/eeg/sub-2_ses-1_space-CapTrak_electrodes.tsv.
Not fully anonymizing info - keeping hand, his_id, sex of subject_info
Reading 0 ... 213999 = 0.000 ... 855.996 secs...
Extracting EDF parameters from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-1/eeg/sub-2_ses-1_task-imagery_run-1_eeg.edf...
Setting channel info structure...
Creating raw.info structure...
Reading channel info from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-1/eeg/sub-2_ses-1_task-imagery_run-1_channels.tsv.
Reading electrode coords from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-1/eeg/sub-2_ses-1_space-CapTrak_electrodes.tsv.
Not fully anonymizing info - keeping hand, his_id, sex of subject_info
Reading 0 ... 175499 = 0.000 ... 701.996 secs...
Extracting EDF parameters from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-2/eeg/sub-2_ses-2_task-imagery_run-0_eeg.edf...
Setting channel info structure...
Creating raw.info structure...
Reading channel info from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-2/eeg/sub-2_ses-2_task-imagery_run-0_channels.tsv.
Reading electrode coords from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-2/eeg/sub-2_ses-2_space-CapTrak_electrodes.tsv.
Not fully anonymizing info - keeping hand, his_id, sex of subject_info
Reading 0 ... 213249 = 0.000 ... 852.996 secs...
Extracting EDF parameters from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-2/eeg/sub-2_ses-2_task-imagery_run-1_eeg.edf...
Setting channel info structure...
Creating raw.info structure...
Reading channel info from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-2/eeg/sub-2_ses-2_task-imagery_run-1_channels.tsv.
Reading electrode coords from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-2/eeg/sub-2_ses-2_space-CapTrak_electrodes.tsv.
Not fully anonymizing info - keeping hand, his_id, sex of subject_info
Reading 0 ... 217749 = 0.000 ... 870.996 secs...
Computing rank from data with rank=None
Using tolerance 1 (2.2e-16 eps * 3 dim * 1.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1 (2.2e-16 eps * 3 dim * 1.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1 (2.2e-16 eps * 3 dim * 1.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1 (2.2e-16 eps * 3 dim * 1.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 0.99 (2.2e-16 eps * 3 dim * 1.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1 (2.2e-16 eps * 3 dim * 1.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1 (2.2e-16 eps * 3 dim * 1.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1 (2.2e-16 eps * 3 dim * 1.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1 (2.2e-16 eps * 3 dim * 1.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1 (2.2e-16 eps * 3 dim * 1.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 0.99 (2.2e-16 eps * 3 dim * 1.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1 (2.2e-16 eps * 3 dim * 1.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 0.99 (2.2e-16 eps * 3 dim * 1.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1 (2.2e-16 eps * 3 dim * 1.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 0.99 (2.2e-16 eps * 3 dim * 1.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.7 (2.2e-16 eps * 3 dim * 2.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.7 (2.2e-16 eps * 3 dim * 2.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.7 (2.2e-16 eps * 3 dim * 2.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.7 (2.2e-16 eps * 3 dim * 2.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.7 (2.2e-16 eps * 3 dim * 2.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.6 (2.2e-16 eps * 3 dim * 2.4e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.6 (2.2e-16 eps * 3 dim * 2.4e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.6 (2.2e-16 eps * 3 dim * 2.4e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.6 (2.2e-16 eps * 3 dim * 2.4e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.6 (2.2e-16 eps * 3 dim * 2.4e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 2 (2.2e-16 eps * 3 dim * 3.1e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 2 (2.2e-16 eps * 3 dim * 3e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.8 (2.2e-16 eps * 3 dim * 2.7e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 2 (2.2e-16 eps * 3 dim * 3.1e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 2 (2.2e-16 eps * 3 dim * 3e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 2.8 (2.2e-16 eps * 3 dim * 4.2e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 3 (2.2e-16 eps * 3 dim * 4.4e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 2.9 (2.2e-16 eps * 3 dim * 4.3e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 2.9 (2.2e-16 eps * 3 dim * 4.4e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 2.9 (2.2e-16 eps * 3 dim * 4.3e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.7 (2.2e-16 eps * 3 dim * 2.6e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.7 (2.2e-16 eps * 3 dim * 2.6e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.7 (2.2e-16 eps * 3 dim * 2.6e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.7 (2.2e-16 eps * 3 dim * 2.6e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.8 (2.2e-16 eps * 3 dim * 2.7e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.5 (2.2e-16 eps * 3 dim * 2.3e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.5 (2.2e-16 eps * 3 dim * 2.3e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.5 (2.2e-16 eps * 3 dim * 2.3e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.5 (2.2e-16 eps * 3 dim * 2.3e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.5 (2.2e-16 eps * 3 dim * 2.3e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.6 (2.2e-16 eps * 3 dim * 2.3e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.6 (2.2e-16 eps * 3 dim * 2.3e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.6 (2.2e-16 eps * 3 dim * 2.3e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.5 (2.2e-16 eps * 3 dim * 2.3e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.6 (2.2e-16 eps * 3 dim * 2.3e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
score time samples ... dataset pipeline codecarbon_task_name
0 0.851852 0.031970 90.0 ... Zhou2016 csp+lda
1 0.908000 0.020655 100.0 ... Zhou2016 csp+lda
2 0.920000 0.020938 100.0 ... Zhou2016 csp+lda
3 0.950000 0.019486 100.0 ... Zhou2016 csp+lda
4 0.843308 0.023855 119.0 ... Zhou2016 csp+lda
[5 rows x 13 columns]
Electrode Selection#
It is possible to select the electrodes that are shared by all datasets using the find_intersecting_channels function. Datasets that have 0 overlap with others are discarded. It returns the set of common channels, as well as the list of datasets with valid channels.
electrodes, datasets = find_intersecting_channels(datasets)
evaluation = WithinSessionEvaluation(
paradigm=paradigm, datasets=datasets, overwrite=True, suffix="resample"
)
results = evaluation.process({"csp+lda": csp_lda, "ts+lr": ts_lr})
print(results.head())
Extracting EDF parameters from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-0/eeg/sub-1_ses-0_task-imagery_run-0_eeg.edf...
Setting channel info structure...
Creating raw.info structure...
Reading channel info from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-0/eeg/sub-1_ses-0_task-imagery_run-0_channels.tsv.
Reading electrode coords from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-0/eeg/sub-1_ses-0_space-CapTrak_electrodes.tsv.
Not fully anonymizing info - keeping hand, his_id, sex of subject_info
Reading 0 ... 305249 = 0.000 ... 1220.996 secs...
Extracting EDF parameters from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-0/eeg/sub-1_ses-0_task-imagery_run-1_eeg.edf...
Setting channel info structure...
Creating raw.info structure...
Reading channel info from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-0/eeg/sub-1_ses-0_task-imagery_run-1_channels.tsv.
Reading electrode coords from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-0/eeg/sub-1_ses-0_space-CapTrak_electrodes.tsv.
Not fully anonymizing info - keeping hand, his_id, sex of subject_info
Reading 0 ... 430499 = 0.000 ... 1721.996 secs...
Extracting EDF parameters from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-1/eeg/sub-1_ses-1_task-imagery_run-0_eeg.edf...
Setting channel info structure...
Creating raw.info structure...
Reading channel info from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-1/eeg/sub-1_ses-1_task-imagery_run-0_channels.tsv.
Reading electrode coords from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-1/eeg/sub-1_ses-1_space-CapTrak_electrodes.tsv.
Not fully anonymizing info - keeping hand, his_id, sex of subject_info
Reading 0 ... 252749 = 0.000 ... 1010.996 secs...
Extracting EDF parameters from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-1/eeg/sub-1_ses-1_task-imagery_run-1_eeg.edf...
Setting channel info structure...
Creating raw.info structure...
Reading channel info from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-1/eeg/sub-1_ses-1_task-imagery_run-1_channels.tsv.
Reading electrode coords from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-1/eeg/sub-1_ses-1_space-CapTrak_electrodes.tsv.
Not fully anonymizing info - keeping hand, his_id, sex of subject_info
Reading 0 ... 296749 = 0.000 ... 1186.996 secs...
Extracting EDF parameters from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-2/eeg/sub-1_ses-2_task-imagery_run-0_eeg.edf...
Setting channel info structure...
Creating raw.info structure...
Reading channel info from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-2/eeg/sub-1_ses-2_task-imagery_run-0_channels.tsv.
Reading electrode coords from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-2/eeg/sub-1_ses-2_space-CapTrak_electrodes.tsv.
Not fully anonymizing info - keeping hand, his_id, sex of subject_info
Reading 0 ... 233249 = 0.000 ... 932.996 secs...
Extracting EDF parameters from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-2/eeg/sub-1_ses-2_task-imagery_run-1_eeg.edf...
Setting channel info structure...
Creating raw.info structure...
Reading channel info from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-2/eeg/sub-1_ses-2_task-imagery_run-1_channels.tsv.
Reading electrode coords from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-2/eeg/sub-1_ses-2_space-CapTrak_electrodes.tsv.
Not fully anonymizing info - keeping hand, his_id, sex of subject_info
Reading 0 ... 226249 = 0.000 ... 904.996 secs...
Extracting EDF parameters from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-0/eeg/sub-1_ses-0_task-imagery_run-0_eeg.edf...
Setting channel info structure...
Creating raw.info structure...
Reading channel info from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-0/eeg/sub-1_ses-0_task-imagery_run-0_channels.tsv.
Reading electrode coords from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-0/eeg/sub-1_ses-0_space-CapTrak_electrodes.tsv.
Not fully anonymizing info - keeping hand, his_id, sex of subject_info
Reading 0 ... 305249 = 0.000 ... 1220.996 secs...
Extracting EDF parameters from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-0/eeg/sub-1_ses-0_task-imagery_run-1_eeg.edf...
Setting channel info structure...
Creating raw.info structure...
Reading channel info from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-0/eeg/sub-1_ses-0_task-imagery_run-1_channels.tsv.
Reading electrode coords from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-0/eeg/sub-1_ses-0_space-CapTrak_electrodes.tsv.
Not fully anonymizing info - keeping hand, his_id, sex of subject_info
Reading 0 ... 430499 = 0.000 ... 1721.996 secs...
Extracting EDF parameters from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-1/eeg/sub-1_ses-1_task-imagery_run-0_eeg.edf...
Setting channel info structure...
Creating raw.info structure...
Reading channel info from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-1/eeg/sub-1_ses-1_task-imagery_run-0_channels.tsv.
Reading electrode coords from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-1/eeg/sub-1_ses-1_space-CapTrak_electrodes.tsv.
Not fully anonymizing info - keeping hand, his_id, sex of subject_info
Reading 0 ... 252749 = 0.000 ... 1010.996 secs...
Extracting EDF parameters from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-1/eeg/sub-1_ses-1_task-imagery_run-1_eeg.edf...
Setting channel info structure...
Creating raw.info structure...
Reading channel info from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-1/eeg/sub-1_ses-1_task-imagery_run-1_channels.tsv.
Reading electrode coords from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-1/eeg/sub-1_ses-1_space-CapTrak_electrodes.tsv.
Not fully anonymizing info - keeping hand, his_id, sex of subject_info
Reading 0 ... 296749 = 0.000 ... 1186.996 secs...
Extracting EDF parameters from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-2/eeg/sub-1_ses-2_task-imagery_run-0_eeg.edf...
Setting channel info structure...
Creating raw.info structure...
Reading channel info from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-2/eeg/sub-1_ses-2_task-imagery_run-0_channels.tsv.
Reading electrode coords from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-2/eeg/sub-1_ses-2_space-CapTrak_electrodes.tsv.
Not fully anonymizing info - keeping hand, his_id, sex of subject_info
Reading 0 ... 233249 = 0.000 ... 932.996 secs...
Extracting EDF parameters from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-2/eeg/sub-1_ses-2_task-imagery_run-1_eeg.edf...
Setting channel info structure...
Creating raw.info structure...
Reading channel info from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-2/eeg/sub-1_ses-2_task-imagery_run-1_channels.tsv.
Reading electrode coords from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-1/ses-2/eeg/sub-1_ses-2_space-CapTrak_electrodes.tsv.
Not fully anonymizing info - keeping hand, his_id, sex of subject_info
Reading 0 ... 226249 = 0.000 ... 904.996 secs...
Extracting EDF parameters from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-0/eeg/sub-2_ses-0_task-imagery_run-0_eeg.edf...
Setting channel info structure...
Creating raw.info structure...
Reading channel info from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-0/eeg/sub-2_ses-0_task-imagery_run-0_channels.tsv.
Reading electrode coords from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-0/eeg/sub-2_ses-0_space-CapTrak_electrodes.tsv.
Not fully anonymizing info - keeping hand, his_id, sex of subject_info
Reading 0 ... 227749 = 0.000 ... 910.996 secs...
Extracting EDF parameters from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-0/eeg/sub-2_ses-0_task-imagery_run-1_eeg.edf...
Setting channel info structure...
Creating raw.info structure...
Reading channel info from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-0/eeg/sub-2_ses-0_task-imagery_run-1_channels.tsv.
Reading electrode coords from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-0/eeg/sub-2_ses-0_space-CapTrak_electrodes.tsv.
Not fully anonymizing info - keeping hand, his_id, sex of subject_info
Reading 0 ... 216249 = 0.000 ... 864.996 secs...
Extracting EDF parameters from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-1/eeg/sub-2_ses-1_task-imagery_run-0_eeg.edf...
Setting channel info structure...
Creating raw.info structure...
Reading channel info from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-1/eeg/sub-2_ses-1_task-imagery_run-0_channels.tsv.
Reading electrode coords from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-1/eeg/sub-2_ses-1_space-CapTrak_electrodes.tsv.
Not fully anonymizing info - keeping hand, his_id, sex of subject_info
Reading 0 ... 213999 = 0.000 ... 855.996 secs...
Extracting EDF parameters from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-1/eeg/sub-2_ses-1_task-imagery_run-1_eeg.edf...
Setting channel info structure...
Creating raw.info structure...
Reading channel info from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-1/eeg/sub-2_ses-1_task-imagery_run-1_channels.tsv.
Reading electrode coords from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-1/eeg/sub-2_ses-1_space-CapTrak_electrodes.tsv.
Not fully anonymizing info - keeping hand, his_id, sex of subject_info
Reading 0 ... 175499 = 0.000 ... 701.996 secs...
Extracting EDF parameters from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-2/eeg/sub-2_ses-2_task-imagery_run-0_eeg.edf...
Setting channel info structure...
Creating raw.info structure...
Reading channel info from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-2/eeg/sub-2_ses-2_task-imagery_run-0_channels.tsv.
Reading electrode coords from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-2/eeg/sub-2_ses-2_space-CapTrak_electrodes.tsv.
Not fully anonymizing info - keeping hand, his_id, sex of subject_info
Reading 0 ... 213249 = 0.000 ... 852.996 secs...
Extracting EDF parameters from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-2/eeg/sub-2_ses-2_task-imagery_run-1_eeg.edf...
Setting channel info structure...
Creating raw.info structure...
Reading channel info from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-2/eeg/sub-2_ses-2_task-imagery_run-1_channels.tsv.
Reading electrode coords from /home/runner/work/moabb/moabb/mne_data/MNE-zhou2016-data/nm000115/sub-2/ses-2/eeg/sub-2_ses-2_space-CapTrak_electrodes.tsv.
Not fully anonymizing info - keeping hand, his_id, sex of subject_info
Reading 0 ... 217749 = 0.000 ... 870.996 secs...
Computing rank from data with rank=None
Using tolerance 1 (2.2e-16 eps * 3 dim * 1.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1 (2.2e-16 eps * 3 dim * 1.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1 (2.2e-16 eps * 3 dim * 1.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1 (2.2e-16 eps * 3 dim * 1.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1 (2.2e-16 eps * 3 dim * 1.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1 (2.2e-16 eps * 3 dim * 1.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1 (2.2e-16 eps * 3 dim * 1.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 0.98 (2.2e-16 eps * 3 dim * 1.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 0.99 (2.2e-16 eps * 3 dim * 1.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 0.99 (2.2e-16 eps * 3 dim * 1.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1 (2.2e-16 eps * 3 dim * 1.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1 (2.2e-16 eps * 3 dim * 1.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1 (2.2e-16 eps * 3 dim * 1.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1 (2.2e-16 eps * 3 dim * 1.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1 (2.2e-16 eps * 3 dim * 1.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.6 (2.2e-16 eps * 3 dim * 2.4e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.6 (2.2e-16 eps * 3 dim * 2.4e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.6 (2.2e-16 eps * 3 dim * 2.4e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.6 (2.2e-16 eps * 3 dim * 2.4e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.6 (2.2e-16 eps * 3 dim * 2.4e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 2 (2.2e-16 eps * 3 dim * 3e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.8 (2.2e-16 eps * 3 dim * 2.7e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 2 (2.2e-16 eps * 3 dim * 3.1e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 2 (2.2e-16 eps * 3 dim * 3e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 2 (2.2e-16 eps * 3 dim * 3.1e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.7 (2.2e-16 eps * 3 dim * 2.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.7 (2.2e-16 eps * 3 dim * 2.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.6 (2.2e-16 eps * 3 dim * 2.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.7 (2.2e-16 eps * 3 dim * 2.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.7 (2.2e-16 eps * 3 dim * 2.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.7 (2.2e-16 eps * 3 dim * 2.6e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.7 (2.2e-16 eps * 3 dim * 2.6e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.7 (2.2e-16 eps * 3 dim * 2.6e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.8 (2.2e-16 eps * 3 dim * 2.6e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.8 (2.2e-16 eps * 3 dim * 2.6e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 2.8 (2.2e-16 eps * 3 dim * 4.2e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 2.9 (2.2e-16 eps * 3 dim * 4.3e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 2.9 (2.2e-16 eps * 3 dim * 4.4e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 2.9 (2.2e-16 eps * 3 dim * 4.3e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 3 (2.2e-16 eps * 3 dim * 4.5e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.6 (2.2e-16 eps * 3 dim * 2.3e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.5 (2.2e-16 eps * 3 dim * 2.3e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.5 (2.2e-16 eps * 3 dim * 2.3e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.6 (2.2e-16 eps * 3 dim * 2.3e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.6 (2.2e-16 eps * 3 dim * 2.3e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.5 (2.2e-16 eps * 3 dim * 2.3e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.5 (2.2e-16 eps * 3 dim * 2.3e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.5 (2.2e-16 eps * 3 dim * 2.3e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.5 (2.2e-16 eps * 3 dim * 2.3e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
Computing rank from data with rank=None
Using tolerance 1.5 (2.2e-16 eps * 3 dim * 2.3e+15 max singular value)
Estimated rank (data): 3
data: rank 3 computed from 3 data channels with 0 projectors
Reducing data rank from 3 -> 3
Estimating class=0 covariance using EMPIRICAL
Done.
Estimating class=1 covariance using EMPIRICAL
Done.
score time samples ... dataset pipeline codecarbon_task_name
0 0.910000 0.023220 100.0 ... Zhou2016 csp+lda
1 0.926000 0.021450 100.0 ... Zhou2016 csp+lda
2 0.839506 0.020984 90.0 ... Zhou2016 csp+lda
3 0.848611 0.023986 119.0 ... Zhou2016 csp+lda
4 0.900000 0.019716 100.0 ... Zhou2016 csp+lda
[5 rows x 13 columns]
Plot Results#
Compare the obtained results with the two pipelines, CSP+LDA and logistic regression computed in the tangent space of the covariance matrices.
chance_levels = chance_by_chance(results, alpha=[0.05, 0.01])
fig = moabb_plt.paired_plot(results, "csp+lda", "ts+lr", chance_level=chance_levels)
plt.show()

Total running time of the script: (0 minutes 44.527 seconds)