pyriemann
Machine learning for multivariate data with Riemannian geometry
What it is and what it does
pyRiemann is a machine learning library that applies Riemannian geometry to classify multivariate data, particularly biosignals like EEG, MEG, and EMG. It estimates covariance matrices from multichannel time series and uses the geometric properties of symmetric positive definite (SPD) matrices to build classifiers. The package follows scikit-learn conventions, making it easy to integrate into standard machine learning pipelines and workflows.
The library was designed around brain-computer interface (BCI) applications, supporting motor imagery, event-related potentials, and steady-state visually evoked potentials paradigms. It also handles remote sensing tasks involving hyperspectral and synthetic-aperture radar imagery. Core utilities support both NumPy and PyTorch backends transparently through the Python Array API, enabling optional GPU acceleration when PyTorch tensors are used. Transfer learning between sessions or subjects is supported through extended labels.
Use it for:
- Build BCI systems that classify motor imagery or event-related potentials from multichannel EEG recordings
- Process hyperspectral remote sensing imagery by estimating and classifying covariance matrices over spatial regions
- Perform transfer learning across BCI recording sessions or subjects using Riemannian geometry
- Classify synthetic-aperture radar (SAR) images using Hermitian positive definite matrix geometry
- Pipeline covariance estimation with tangent-space projection and standard classifiers
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
pyRiemann provides scikit-learn-compatible machine learning algorithms for classifying multivariate data using Riemannian geometry of symmetric positive definite matrices, with support for both NumPy and PyTorch backends.
Yes. Active maintenance, low install friction, permissive license, and no known vulnerabilities make it safe to adopt. The scikit-learn-compatible API and support for both NumPy and PyTorch backends provide flexibility. Install if you work with multivariate biosignals, BCI systems, or remote sensing imagery requiring Riemannian geometric classification.
Install
pyriemann on PyPI
pip
pip install pyriemannuv
uv add pyriemannpoetry
poetry add pyriemannInstalling pyriemann
Before you install
Low friction: pure-Python wheel distribution with well-established dependencies (numpy, scipy, scikit-learn). Active maintenance with a recent release 44 days ago and ongoing repository activity.
License in practice
BSD 3-clause permissive license allows commercial and private use with minimal restrictions; attribution required but no copyleft obligations.
Quickstart
pip install pyriemann
import pyriemann
from pyriemann.estimation import Covariances
from pyriemann.classification import MDM
X = ... # EEG data: n_epochs x n_channels x n_times
y = ... # labels
cov = Covariances().fit_transform(X)
mdm = MDM()
print(mdm.fit(cov, y).score(cov, y))
Requires Python >=3.9; designed for multichannel time-series data in specific format (n_epochs x n_channels x n_times).
Verify before relying
- Whether PyTorch backend integration requires PyTorch as an optional dependency or works transparently when installed
- Performance characteristics and scalability limits for large covariance matrix datasets
- Specific BCI paradigm support beyond motor imagery, ERP, and SSVEP mentioned in documentation
Package facts
| License | BSD (3-clause) (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 7 — numpy, scipy, scikit-learn, array-api-compat, array-api-extra, joblib, matplotlib |
| Maintenance | actively maintained — 44 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 89,512/month — #13,654 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyriemann-0.12-py2.py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
cornerGenerates publication-quality corner plots…
permissive · top 15,000 on PyPI
gmrGaussian Mixture Models for clustering and…
permissive · top 15,000 on PyPI
pytsPyts provides time series classification…
permissive · top 15,000 on PyPI
mace-torchMACE trains and evaluates machine learning…
permissive · top 15,000 on PyPI
spark-sklearnDistributes scikit-learn model training and…
permissive · top 15,000 on PyPI
nilearnNilearn provides statistical and…
permissive · top 15,000 on PyPI
pypotsPyPOTS provides machine learning algorithms for…
permissive · top 15,000 on PyPI
linear-operatorLinearOperator abstracts structured matrix…
permissive · top 5,000 on PyPI
mneMNE-Python provides tools for exploring,…
permissive · top 5,000 on PyPI