Metadata-Version: 2.4
Name: moabbr
Version: 0.1.1
Summary: MOABB interface to tombolo for analysis of ML benchmarks
Project-URL: Source, https://github.com/davisethan/moabbr
Project-URL: Homepage, https://davisethan.github.io/moabbr
Project-URL: Docker Hub, https://hub.docker.com/r/ethandavisecd/tombolo
Author-email: Ethan Davis <ethandavisecd@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: BCI,EEG,ML,MOABB,R
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.9
Requires-Dist: duckdb
Requires-Dist: pandas
Requires-Dist: tombolo
Description-Content-Type: text/markdown

# moabbr

[MOABB](https://neurotechx.github.io/moabb/) interface to [tombolo](https://pypi.org/project/tombolo/) for analysis of machine learning benchmarks.

MOABB evaluation results are a pandas DataFrame with one row per pipeline/dataset/subject/session. moabbr transforms this into the format tombolo expects using DuckDB, then calls the tombolo Docker image to run the analysis. Each dataset is treated as an independent study and each pipeline as a treatment.

## Requirements

[Docker](https://docs.docker.com/get-started/get-docker/) must be installed and running, and the tombolo image must be pulled:

```
docker pull ethandavisecd/tombolo:latest
```

## Installation

```
pip install moabbr
```

## Usage

`results` is the `pd.DataFrame` returned by a MOABB evaluation, with columns `dataset`, `pipeline`, `subject`, and `score`.

```python
from moabbr import nma, bnma

data = moabbr.nma(results)    # frequentist NMA via netmeta
data = moabbr.bnma(results)   # Bayesian NMA via gemtc
```

Both functions accept a `greater_is_better` flag (default `True`). Set to `False` for metrics where lower is better (e.g. error rate).

## Plots

```python
from moabbr.plots import (
    ranking_plot,
    league_table,
    forest_plot,
    heterogeneity_table,
    prediction_table,  # nma only
    convergence_table, # bnma only
)

ranking_plot(result)
league_table(result)
forest_plot(result, reference="my_pipeline")
heterogeneity_table(result)
```

Each function returns a `matplotlib.figure.Figure`.