Skip to main content

coco-pipe

CI Docs Codecov PyPI - Version License: MIT

A modular framework for biosignal analytics, machine learning, deep learning, and foundation-model workflows.

coco-pipe was originally developed for M/EEG research and provides reusable components for data loading, feature extraction, dimensionality reduction, decoding, visualization, and automated reporting. The framework is designed to support reproducible machine-learning and foundation-model workflows across neuroimaging and biosignal modalities, with planned support for fMRI, fNIRS, and related data types.


Highlights

  • Biosignal-first design for M/EEG, tabular, and biomedical datasets.
  • Modular architecture for building reusable analysis pipelines.
  • Machine-learning workflows for classification, regression, feature selection, and hyperparameter optimization.
  • Foundation-model workflows for embedding extraction, linear probing, full fine-tuning, parameter-efficient fine-tuning (LoRA/PEFT), and downstream decoding.
  • Dimensionality-reduction tools for exploratory analysis, embedding comparison, visualization, clustering, and trajectory analysis.
  • Automated reporting for reproducible experiment summaries and analysis outputs.

Built On

coco-pipe integrates with many widely used scientific Python libraries, including:

  • MNE-Python
  • Braindecode
  • MOABB
  • scikit-learn
  • PyTorch
  • Hugging Face Transformers
  • PEFT
  • UMAP
  • PHATE
  • PaCMAP
  • Dask

Installation

With pip

pip install coco-pipe

Optional modules come as extras, for example pip install "coco-pipe[full]" for all of them.

From source

git clone https://github.com/BabaSanfour/coco-pipe.git
cd coco-pipe
pip install -e .

Development installation:

pip install -e .[dev,test]

Full installation (all optional modules):

pip install -e .[full,test]

With uv

git clone https://github.com/BabaSanfour/coco-pipe.git
cd coco-pipe

uv venv
source .venv/bin/activate

uv pip install -e .

Development installation:

uv pip install -e ".[dev,test]"

Full installation:

uv pip install -e ".[full,test]"

Saved epochs and mne-bids

BIDSDataset reads saved epochs (*_epo.fif) with mne_bids.read_epochs_bids, which reads FIF epochs from mne-bids PR #1679 on. Until that is in a release, install mne-bids from GitHub:

pip install "mne-bids @ git+https://github.com/mne-tools/mne-bids.git@main"

With mne-bids 0.20, loading saved epochs fails and the tests that need it are skipped.


Modules

Module Role
io Dataset loading, validation, and organization.
descriptors Signal feature extraction and representation building.
dim_reduction Representation learning and dimensionality reduction.
decoding Classification, regression, and model evaluation workflows.
viz Exploratory analysis and publication-quality visualizations.
report Automated experiment summaries and reporting.

Quick Start

The decoding API centers around the Experiment class:

from coco_pipe.decoding import Experiment, ExperimentConfig
from coco_pipe.decoding.configs import (
    CVConfig,
    LogisticRegressionConfig,
)

config = ExperimentConfig(
    task="classification",
    models={
        "logreg": LogisticRegressionConfig(max_iter=500)
    },
    metrics=["accuracy"],
    cv=CVConfig(
        strategy="stratified",
        n_splits=5,
        shuffle=True,
        random_state=42,
    ),
)

result = Experiment(config).run(X, y)

print(result.summary())

More advanced workflows, including feature selection, temporal decoding, dimensionality reduction, foundation-model integration, and automated reporting, are covered in the documentation.


Documentation

Documentation, tutorials, examples, and API references are available at:

https://babasanfour.github.io/coco-pipe/


Contributing

Contributions are welcome, including:

  • Bug reports
  • Documentation improvements
  • Examples and tutorials
  • New analysis modules
  • Tests and infrastructure improvements
  • Performance optimizations

Please read CONTRIBUTING.md before opening a pull request.


Citation

If you use coco-pipe in academic work, please cite the associated publication(s) when available.

Citation information will be added here as the project matures.


License

coco-pipe is distributed under the terms of the MIT License.

Metadata

Release files for coco-pipe 0.0.3

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

Source distribution (sdist)

Source distribution for coco-pipe 0.0.3
File Size Uploaded
coco_pipe-0.0.3.tar.gz 749.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for coco-pipe 0.0.3
File Interpreter ABI Platform
coco_pipe-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 1.4 MB

Release files / coco_pipe-0.0.3.tar.gz

Download URL coco_pipe-0.0.3.tar.gz
Size 749.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4650c94cdd317ecddcf0e53baf8ce62eec1782fc811200032e3fc9760b3beef9
BLAKE2b-256 checksum
How to use checksums
3e04fb51ef57f94f6bc104d3135e0c79a500f647aa1a796a5194a81aa89ef7c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Release files / coco_pipe-0.0.3-py3-none-any.whl

Download URL coco_pipe-0.0.3-py3-none-any.whl
Size 626.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d60df0c4bbc255664cb63fdd05f64d49db670208f43cf465dda8aaad84fe463
BLAKE2b-256 checksum
How to use checksums
8d7341ce0a713ff80901fff99ca4b9dafb11979353bf84d1954c4f18199597eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

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