Skip to main content

autoreject

CircleCI GitHub Actions Codecov PyPI Conda-Forge

This is a library to automatically reject bad trials and repair bad sensors in magneto-/electroencephalography (M/EEG) data.

https://autoreject.github.io/stable/_images/sphx_glr_plot_auto_repair_001.png

The documentation can be found under the following links:

Installation

We recommend the Anaconda Python distribution and a Python version >= 3.11. We furthermore recommend that you install autoreject into an isolated Python environment. To obtain the stable release of autoreject, you can use pip:

pip install -U autoreject

Or conda:

conda install -c conda-forge autoreject

If you want the latest (development) version of autoreject, use:

pip install https://github.com/autoreject/autoreject/archive/refs/heads/main.zip

To check if everything worked fine, you can do:

python -c 'import autoreject'

and it should not give any error messages.

Below, we list the dependencies for autoreject. All required dependencies are installed automatically when you install autoreject.

  • mne (>=1.5.0)

  • numpy (>=1.21.2)

  • scipy (>=1.7.1)

  • scikit-learn (>=1.0.0)

  • joblib

  • matplotlib (>=3.5.0)

Optional dependencies are:

  • openneuro-py (>= 2021.10.1, for fetching data from OpenNeuro.org)

Quickstart

The easiest way to get started is to copy the following three lines of code in your script:

>>> from autoreject import AutoReject
>>> ar = AutoReject()
>>> epochs_clean = ar.fit_transform(epochs)  # doctest: +SKIP

This will automatically clean an epochs object read in using MNE-Python. To get the rejection dictionary, simply do:

>>> from autoreject import get_rejection_threshold
>>> reject = get_rejection_threshold(epochs)  # doctest: +SKIP

We also implement RANSAC from the PREP pipeline (see PyPREP for a full implementation of the PREP pipeline). The API is the same:

>>> from autoreject import Ransac
>>> rsc = Ransac()
>>> epochs_clean = rsc.fit_transform(epochs)  # doctest: +SKIP

For more details check out the example to automatically detect and repair bad epochs.

Bug reports

Please use the GitHub issue tracker to report bugs.

Cite

[1] Mainak Jas, Denis Engemann, Federico Raimondo, Yousra Bekhti, and Alexandre Gramfort, “Automated rejection and repair of bad trials in MEG/EEG”. In 6th International Workshop on Pattern Recognition in Neuroimaging (PRNI), 2016.

[2] Mainak Jas, Denis Engemann, Yousra Bekhti, Federico Raimondo, and Alexandre Gramfort. 2017. “Autoreject: Automated artifact rejection for MEG and EEG data”. NeuroImage, 159, 417-429.

Metadata

Release files for autoreject 0.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for autoreject 0.5.2
File Size Uploaded Provenance Actions
autoreject-0.5.2.tar.gz 33.5 kB Without provenance Details for autoreject-0.5.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for autoreject 0.5.2
File Interpreter ABI Platform Actions
autoreject-0.5.2-py3-none-any.whl Python 3 none any Details for autoreject-0.5.2-py3-none-any.whl

Total release size: 66.5 kB

Release files / autoreject-0.5.2.tar.gz

Download URL autoreject-0.5.2.tar.gz
Size 33.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b5ad629f9a644cb851ba90754cc33fd1b97e7a8b496f996357205c69fd06eb7f
BLAKE2b-256 checksum
How to use checksums
071f4d503732f4ddd668d08a3b9b39c2a18a5a9b582279a2d4ec812ea8762a78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.9

Release files / autoreject-0.5.2-py3-none-any.whl

Download URL autoreject-0.5.2-py3-none-any.whl
Size 33.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d17035621f0447caaf35f507bf337c358acf09ff4cb28ed86466ed7f0b1f814e
BLAKE2b-256 checksum
How to use checksums
ad3bf7e1bbe8505ddce1d51315713f29ab7f928cd3d1153f4a9ceabfece6440d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.9

Security for autoreject 0.5.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page