All Projects → alexandrebarachant → Pyriemann

alexandrebarachant / Pyriemann

Licence: other
Python package for covariance matrices manipulation and Biosignal classification with application in Brain Computer interface

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pyriemann

cortex-v2-example
Example with Cortex V2 API
Stars: ✭ 121 (-55.51%)
Mutual labels:  neuroscience, eeg
Eegrunt
A Collection Python EEG (+ ECG) Analysis Utilities for OpenBCI and Muse
Stars: ✭ 171 (-37.13%)
Mutual labels:  neuroscience, eeg
Entropy
EntroPy: complexity of time-series in Python (DEPRECATED)
Stars: ✭ 142 (-47.79%)
Mutual labels:  neuroscience, eeg
Analyzing neural time series
python implementations of Analyzing Neural Time Series Textbook
Stars: ✭ 117 (-56.99%)
Mutual labels:  neuroscience, eeg
python-meegkit
🔧🧠 MEEGkit: MEG & EEG processing toolkit in Python 🧠🔧
Stars: ✭ 99 (-63.6%)
Mutual labels:  neuroscience, eeg
Tapas
TAPAS - Translational Algorithms for Psychiatry-Advancing Science
Stars: ✭ 121 (-55.51%)
Mutual labels:  neuroscience, eeg
Brainflow
BrainFlow is a library intended to obtain, parse and analyze EEG, EMG, ECG and other kinds of data from biosensors
Stars: ✭ 170 (-37.5%)
Mutual labels:  neuroscience, eeg
Fieldtrip
The MATLAB toolbox for MEG, EEG and iEEG analysis
Stars: ✭ 481 (+76.84%)
Mutual labels:  neuroscience, eeg
pyRiemann
Python machine learning package based on sklearn API for multivariate data processing and statistical analysis of symmetric positive definite matrices via Riemannian geometry
Stars: ✭ 470 (+72.79%)
Mutual labels:  neuroscience, eeg
Moabb
Mother of All BCI Benchmarks
Stars: ✭ 214 (-21.32%)
Mutual labels:  neuroscience, eeg
Mne Cpp
MNE-CPP: A Framework for Electrophysiology
Stars: ✭ 104 (-61.76%)
Mutual labels:  neuroscience, eeg
antropy
AntroPy: entropy and complexity of (EEG) time-series in Python
Stars: ✭ 111 (-59.19%)
Mutual labels:  neuroscience, eeg
Deepeeg
Deep Learning with Tensor Flow for EEG MNE Epoch Objects
Stars: ✭ 100 (-63.24%)
Mutual labels:  neuroscience, eeg
Mne Python
MNE: Magnetoencephalography (MEG) and Electroencephalography (EEG) in Python
Stars: ✭ 1,766 (+549.26%)
Mutual labels:  neuroscience, eeg
Openbci Dashboard
A fullstack javascript app for capturing and visualizing OpenBCI EEG data
Stars: ✭ 82 (-69.85%)
Mutual labels:  neuroscience, eeg
Fooof
Parameterizing neural power spectra into periodic & aperiodic components.
Stars: ✭ 162 (-40.44%)
Mutual labels:  neuroscience, eeg
Neurokit.py
A Python Toolbox for Statistics and Neurophysiological Signal Processing (EEG, EDA, ECG, EMG...).
Stars: ✭ 292 (+7.35%)
Mutual labels:  neuroscience, eeg
Neurotech Course
CS198-96: Intro to Neurotechnology @ UC Berkeley
Stars: ✭ 202 (-25.74%)
Mutual labels:  neuroscience, eeg
mne-bids
MNE-BIDS is a Python package that allows you to read and write BIDS-compatible datasets with the help of MNE-Python.
Stars: ✭ 88 (-67.65%)
Mutual labels:  neuroscience, eeg
CereLink
Blackrock Microsystems Cerebus Link for Neural Signal Processing
Stars: ✭ 33 (-87.87%)
Mutual labels:  neuroscience, eeg

pyRiemann

Code Climate Build Status codecov DOI Documentation Status

pyriemann is a python package for covariance matrices manipulation and classification through riemannian geometry.

The primary target is classification of multivariate biosignals, like EEG, MEG or EMG.

This is work in progress ... stay tuned.

This code is BSD-licenced (3 clause).

Documentation

The documentation is available on http://pyriemann.readthedocs.io/en/latest/

Install

Using PyPI

pip install pyriemann

or using pip+git for the latest version of the code :

pip install git+https://github.com/alexandrebarachant/pyRiemann

Anaconda is not currently supported, if you want to use anaconda, you need to create a virtual environment in anaconda, activate it and use the above command to install it.

From sources

For the latest version, you can install the package from the sources using the setup.py script

python setup.py install

or in developer mode to be able to modify the sources.

python setup.py develop

How to use it

Most of the functions mimic the scikit-learn API, and therefore can be directly used with sklearn. For example, for cross-validation classification of EEG signal using the MDM algorithm described in [4] , it is easy as :

import pyriemann
from sklearn.model_selection import cross_val_score

# load your data
X = ... # your EEG data, in format Ntrials x Nchannels X Nsamples
y = ... # the labels

# estimate covariances matrices
cov = pyriemann.estimation.Covariances().fit_transform(X)

# cross validation
mdm = pyriemann.classification.MDM()

accuracy = cross_val_score(mdm, cov, y)

print(accuracy.mean())

You can also pipeline methods using sklearn Pipeline framework. For example, to classify EEG signal using a SVM classifier in the tangent space, described in [5] :

from pyriemann.estimation import Covariances
from pyriemann.tangentspace import TangentSpace

from sklearn.pipeline import make_pipeline
from sklearn.svm import SVC
from sklearn.model_selection import cross_val_score

# load your data
X = ... # your EEG data, in format Ntrials x Nchannels X Nsamples
y = ... # the labels

# build your pipeline
covest = Covariances()
ts = TangentSpace()
svc = SVC(kernel='linear')

clf = make_pipeline(covest,ts,svc)
# cross validation
accuracy = cross_val_score(clf, X, y)

print(accuracy.mean())

Check out the example folder for more examples !

Testing

If you make a modification, run the test suite before submitting a pull request

nosetests

Contribution Guidelines

The package aims at adopting the Scikit-Learn and MNE-Python conventions as much as possible. See their contribution guidelines before contributing to the repository.

References

[1] A. Barachant, M. Congedo ,"A Plug&Play P300 BCI Using Information Geometry", arXiv:1409.0107. link

[2] M. Congedo, A. Barachant, A. Andreev ,"A New generation of Brain-Computer Interface Based on Riemannian Geometry", arXiv: 1310.8115. link

[3] A. Barachant and S. Bonnet, "Channel selection procedure using riemannian distance for BCI applications," in 2011 5th International IEEE/EMBS Conference on Neural Engineering (NER), 2011, 348-351. pdf

[4] A. Barachant, S. Bonnet, M. Congedo and C. Jutten, “Multiclass Brain-Computer Interface Classification by Riemannian Geometry,” in IEEE Transactions on Biomedical Engineering, vol. 59, no. 4, p. 920-928, 2012. pdf

[5] A. Barachant, S. Bonnet, M. Congedo and C. Jutten, “Classification of covariance matrices using a Riemannian-based kernel for BCI applications“, in NeuroComputing, vol. 112, p. 172-178, 2013. pdf

changelog

v0.2.6

  • Updated for scikit-learn v0.22
  • Remove support for python 2.7
  • Update the examples to take into account last version of MNE
  • Fix cospectrum and coherency estimation.

v0.2.5

  • Added BilinearFilter
  • Added a permutation test for generic scikit-learn estimator
  • Stats module refactoring, with distance based t-test and f-test
  • Removed two way permutation test
  • Added FlatChannelRemover
  • Support for python 3.5 and 3.6
  • Added Shrinkage transformer
  • Added Coherences transformer
  • Added Embedding class.

v0.2.4

  • Improved documentation
  • Added TSclassifier for out-of the box tangent space classification.
  • Added Wasserstein distance and mean.
  • Added NearestNeighbor classifier.
  • Added Softmax probabilities for MDM.
  • Added CSP for covariance matrices.
  • Added Approximate Joint diagonalization algorithms (JADE, PHAM, UWEDGE).
  • Added ALE mean.
  • Added Multiclass CSP.
  • API: param name changes in CospCovariances to comply to Scikit-Learn.
  • API: attributes name changes in most modules to comply to the Scikit-Learn naming convention.
  • Added HankelCovariances estimation
  • Added SPoC spatial filtering
  • Added Harmonic mean
  • Added Kullback leibler mean

v0.2.3

  • Added multiprocessing for MDM with joblib
  • Added kullback-leibler divergence
  • Added Riemannian Potato
  • Added sample_weight for mean estimation and MDM
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].