Páginas de Pyriemann Documentação
Páginas de Pyriemann Documentação
Decoding applied to EEG data in sensor space decomposed using Xdawn. After spatial filtering, covariances matrices
are estimated, then projected in the tangent space and classified with a logistic regression.
# Authors: Alexandre Barachant <[email protected]>
#
# License: BSD (3-clause)
import numpy as np
import mne
from mne import io
from mne.datasets import sample
print(__doc__)
data_path = sample.data_path()
# Read epochs
epochs = mne.Epochs(raw, events, event_id, tmin, tmax, proj=False,
picks=picks, baseline=None, preload=True, verbose=False)
clf = make_pipeline(XdawnCovariances(n_components),
TangentSpace(metric='riemann'),
LogisticRegression())
preds = np.zeros(len(labels))
clf.fit(epochs_data[train_idx], y_train)
preds[test_idx] = clf.predict(epochs_data[test_idx])
Out: