Skip to main content

CapyMOA

Banner Image

PyPi Version Docker Image Version (tag) Join the Discord Documentation GitHub Coverage Status

CapyMOA does efficient machine learning for data streams in Python. A data stream is a sequence of items that arrive one by one and are too large or urgent to process offline. CapyMOA is a toolbox of methods and evaluators for: classification, regression, clustering, anomaly detection, semi-supervised learning, online continual learning, and drift detection for data streams.

To install:

pip install capymoa

The deep-learning parts of CapyMOA (capymoa.ocl, capymoa.ann, the Batch* learners) need PyTorch, which is an optional extra:

pip install capymoa[torch]

Refer to the Setup guide for other options, including CPU-only PyTorch and dev dependencies.

from capymoa.datasets import Electricity
from capymoa.classifier import HoeffdingTree
from capymoa.evaluation import prequential_evaluation

# 1. Load a streaming dataset
stream = Electricity()

# 2. Create a machine learning model
model = HoeffdingTree(stream.get_schema())

# 3. Run with test-then-train evaluation
results = prequential_evaluation(stream, model)

# 4. Success!
print(f"Accuracy: {results.accuracy():.2f}%")

Next, we recommend the Tutorials.

⚠️ WARNING

CapyMOA is still in the early stages of development. The API is subject to change until version 1.0.0. If you encounter any issues, please report them in GitHub Issues or talk to us on Discord.


Benchmark Image Benchmark comparing CapyMOA against other data stream libraries. The benchmark was performed using an ensemble of 100 ARF learners trained on the capymoa.datasets.RTG_2abrupt dataset containing 100,000 samples and 30 features. You can find the code to reproduce this benchmark in benchmarks/README.md, with the runnable script at benchmarks/benchmarking.py. CapyMOA has the speed of MOA with the flexibility of Python and the richness of Python's data science ecosystem.

Cite Us

If you use CapyMOA in your research, please cite us using the following BibTeX item.

@misc{gomes2025,
  title={{CapyMOA}: Efficient Machine Learning for Data Streams and Online Continual Learning in Python},
  author={Heitor Murilo Gomes and Anton Lee and Nuwan Gunasekara and Yibin Sun and Guilherme Weigert Cassales and Justin Jia Liu and Marco Heyden and Vitor Cerqueira and Maroua Bahri and Yun Sing Koh and Bernhard Pfahringer and Albert Bifet},
  year={2025},
  eprint={2502.07432},
  archivePrefix={arXiv},
  primaryClass={cs.LG},
  url={https://arxiv.org/abs/2502.07432}
}

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

capymoa-0.14.0.tar.gz (61.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

capymoa-0.14.0-py3-none-any.whl (61.7 MB view details)

Uploaded Python 3

File details

Details for the file capymoa-0.14.0.tar.gz.

File metadata

  • Download URL: capymoa-0.14.0.tar.gz
  • Upload date:
  • Size: 61.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for capymoa-0.14.0.tar.gz
Algorithm Hash digest
SHA256 b75a4633d5664474602f4f832c0d4e6651fc25760d718bf8502c66ea98bdcc57
MD5 1b47b290f2289f87649fdb713487685d
BLAKE2b-256 092b2b10ce355bcc2457e4adc730d31f7c903e32ad7956bee4a5f8815f179a10

See more details on using hashes here.

Provenance

The following attestation bundles were made for capymoa-0.14.0.tar.gz:

Publisher: release.yml on adaptive-machine-learning/CapyMOA

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file capymoa-0.14.0-py3-none-any.whl.

File metadata

  • Download URL: capymoa-0.14.0-py3-none-any.whl
  • Upload date:
  • Size: 61.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for capymoa-0.14.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4b43e9c497b822009a6dfac384385b26336a6aebd8af4df671d829f0b089c6cd
MD5 991abb8da11f1945f1f05ac5d05be506
BLAKE2b-256 a60e912fec0891234cba37475543a22b1ba06648ab0dc1a8e4b4d5c8dd218304

See more details on using hashes here.

Provenance

The following attestation bundles were made for capymoa-0.14.0-py3-none-any.whl:

Publisher: release.yml on adaptive-machine-learning/CapyMOA

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page