skillfed

pyriemann

Machine learning for multivariate data with Riemannian geometry

pyriemann v0.12 89.5K downloads/30d#13,654 on PyPI773
Permissive license BSD (3-clause) Active released

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 pyriemann

uv

uv add pyriemann

poetry

poetry add pyriemann

Installing 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

riemannian geometry machine learningEEG classification BCIcovariance matrix classificationbrain-computer interfacemultivariate signal processingSPD matrix learningbiosignal analysis
riemannian-geometrybrain-computer-interfacebiosignal-processing

More Artificial Intelligence packages