Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 33 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,48 @@
# [CapyMOA](https://capymoa.org)

![Banner Image](https://github.com/adaptive-machine-learning/CapyMOA/raw/main/docs/images/CapyMOA.jpeg)
[![Link to PyPI](https://img.shields.io/pypi/v/capymoa)](https://pypi.org/project/capymoa/)
[![image](https://coveralls.io/repos/github/adaptive-machine-learning/CapyMOA/badge.svg?branch=main)](https://coveralls.io/github/adaptive-machine-learning/CapyMOA?branch=main)
[![Link to Discord](https://img.shields.io/discord/1235780483845984367?label=Discord)](https://discord.gg/spd2gQJGAb)
[![Link to GitHub](https://img.shields.io/github/stars/adaptive-machine-learning/CapyMOA?style=flat)](https://github.com/adaptive-machine-learning/CapyMOA)
[![Docker Image Version (tag)](https://img.shields.io/docker/v/tachyonic/jupyter-capymoa/latest?logo=docker&label=Docker&color=blue)](https://hub.docker.com/r/tachyonic/jupyter-capymoa)

[![PyPi Version](https://img.shields.io/pypi/v/capymoa)](https://pypi.org/project/capymoa/)
[![Join the Discord](https://img.shields.io/discord/1235780483845984367?label=Discord)](https://discord.gg/spd2gQJGAb)
[![Documentation](https://img.shields.io/badge/docs-latest-blue)](https://capymoa.org)
[![GitHub](https://img.shields.io/github/stars/adaptive-machine-learning/CapyMOA?style=social)](https://github.com/adaptive-machine-learning/CapyMOA)

**CapyMOA does efficient machine learning for data streams in Python.**
A data stream is a sequences of items ariving one-by-one that is too
large to efficiently process non-sequentially. 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.

Machine learning library tailored for data streams. Featuring a Python API
tightly integrated with MOA (**Stream Learners**), PyTorch (**Neural
Networks**), and scikit-learn (**Machine Learning**). CapyMOA provides a
**fast** python interface to leverage the state-of-the-art algorithms in the
field of data streams.
For the default PyTorch CUDA GPU installation, run:

To setup CapyMOA, simply install it via pip. If you have any issues with the
installation (like not having Java installed) or if you want GPU support, please
refer to the [installation guide](https://capymoa.org/installation). Once installed take a
look at the [tutorials](https://capymoa.org/tutorials.html) to get started.
```
pip install capymoa
```

```bash
# CapyMOA requires Java. This checks if you have it installed
java -version
Refer to the [Setup](https://capymoa.org/setup) guide for other options,
including CPU-only and dev dependencies.

# CapyMOA requires PyTorch. This installs the CPU version
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
```python
from capymoa.datasets import Electricity
from capymoa.classifier import HoeffdingTree
from capymoa.evaluation import prequential_evaluation

# Install CapyMOA and its dependencies
pip install capymoa
# 1. Load a streaming dataset
stream = Electricity()

# Check that the install worked
python -c "import capymoa; print(capymoa.__version__)"
# 2. Create a machine learning model
model = HoeffdingTree(stream.get_schema())

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

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

Next, we recomend the [Tutorials](https://capymoa.org/tutorials).

> **⚠️ WARNING**
>
> CapyMOA is still in the early stages of development. The API is subject to
Expand Down
10 changes: 9 additions & 1 deletion docs/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,12 @@ Functions
---------

.. automodule:: capymoa
:members:
:members:


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
html_theme = "pydata_sphinx_theme"
html_static_path = ["_static"]
html_css_files = ["css/citation.css"]
html_show_sourcelink = False

# Setup symbolic links for notebooks

Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/code_review.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This document describes the code review process for CapyMOA. It is intended for

## Commit Messages

**tldr; Run `python -m invoke commit` (or `invoke commit`, `python -m commitizen commit`) to commit changes.** (Requires that you've [installed the optional development dependencies](../installation.rst).)
**tldr; Run `python -m invoke commit` (or `invoke commit`, `python -m commitizen commit`) to commit changes.** (Requires that you've [installed the optional development dependencies](../setup/developer.rst).)

CapyMOA uses conventional commit messages to streamline the release process.

Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ If a check fails, review the error messages and try to reproduce the issue local

## How do I format my code?
`invoke fmt` will format and check your code using `ruff`. Ruff is installed as part of
the [development dependencies](../installation.rst). Formatting helps make diff reviews
the [development dependencies](../setup/developer.rst). Formatting helps make diff reviews
easier and keeps the codebase consistent.

## How do I write a commit message?
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/git.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ git status
git commit -m "My message"
```

* Refer to the [installation guide](../installation.rst) to set up your development
* Refer to the [installation guide](../setup/developer.rst) to set up your development
environment.

### 5. Upload Your Changes to Your Fork
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/tests.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Adding Tests

Ensure you have installed the development dependencies by following the instructions
in the [installation guide](../installation.rst). To run all tests, use the following command:
in the [installation guide](../setup/developer.rst). To run all tests, use the following command:

```bash
invoke test
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/update_moa.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ project uses. **It is only intended for developers who are contributing to
CapyMOA**. Before you start, make sure you have the following:

* You have installed the development dependencies and have an editable install
of CapyMOA. If you have not, follow the instructions in the [installation guide](../installation.rst).
of CapyMOA. If you have not, follow the instructions in the [installation guide](../setup/developer.rst).

* You must **NOT** have set the environment variables that would
override the default `moa.jar` location. `CAPYMOA_MOA_JAR` must be unset.
Expand Down
147 changes: 55 additions & 92 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
.. CapyMOA documentation master file, created by
sphinx-quickstart on Fri Feb 23 08:41:28 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
.. toctree::
:hidden:

setup/index
tutorials
api/index
about
contributing/index

CapyMOA
=======
Expand All @@ -13,6 +16,9 @@ CapyMOA
.. image:: https://img.shields.io/pypi/v/capymoa
:target: https://pypi.org/project/capymoa/
:alt: Link to PyPI

.. image:: https://coveralls.io/repos/github/adaptive-machine-learning/CapyMOA/badge.svg?branch=main
:target: https://coveralls.io/github/adaptive-machine-learning/CapyMOA?branch=main

.. image:: https://img.shields.io/discord/1235780483845984367?label=Discord
:target: https://discord.gg/spd2gQJGAb
Expand All @@ -22,59 +28,43 @@ CapyMOA
:target: https://github.com/adaptive-machine-learning/CapyMOA
:alt: Link to GitHub

Machine learning library tailored for data streams. Featuring a Python API
tightly integrated with MOA (**Stream Learners**), PyTorch (**Neural
Networks**), and scikit-learn (**Machine Learning**). CapyMOA provides a
**fast** python interface to leverage the state-of-the-art algorithms in the
field of data streams.
.. image:: https://img.shields.io/docker/v/tachyonic/jupyter-capymoa/latest?logo=docker&label=Docker&color=blue
:target: https://hub.docker.com/r/tachyonic/jupyter-capymoa
:alt: Docker Image Version (tag)

To setup CapyMOA, simply install it via pip. If you have any issues with the
installation (like not having Java installed) or if you want GPU support, please
refer to :ref:`installation`. Once installed take a look at the
:ref:`tutorials` to get started.
**CapyMOA does efficient machine learning for data streams in Python.** A data stream is
a sequences of items ariving one-by-one that is too large to efficiently process
non-sequentially. 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.

Install with pip:

.. code-block:: bash

# CapyMOA requires Java. This checks if you have it installed
java -version

# CapyMOA requires PyTorch. This installs the CPU version
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu

# Install CapyMOA and its dependencies
pip install capymoa

# Check that the install worked
python -c "import capymoa; print(capymoa.__version__)"
Refer to the :ref:`setup` guide for other options, including CPU-only and dev dependencies.

.. warning::
.. code-block:: python

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
on the `GitHub Issues <https://github.com/adaptive-machine-learning/CapyMOA/issues>`_
page or talk to us on `Discord <https://discord.gg/spd2gQJGAb>`_.
from capymoa.datasets import Electricity
from capymoa.classifier import HoeffdingTree
from capymoa.evaluation import prequential_evaluation

.. image:: /images/arf100_cpu_time.png
:alt: Performance plot
:align: center
:class: only-light
# 1. Load a streaming dataset
stream = Electricity()

.. image:: /images/arf100_cpu_time_dark.png
:alt: Performance plot
:align: center
:class: only-dark
# 2. Create a machine learning model
model = HoeffdingTree(stream.get_schema())

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

Benchmark comparing CapyMOA against other data stream libraries. The benchmark
was performed using an ensemble of 100 ARF learners trained on
:class:`capymoa.datasets.RTG_2abrupt` dataset containing 100,000 samples and 30
features. You can find the code to reproduce this benchmark in
`benchmarking.py <https://github.com/adaptive-machine-learning/CapyMOA/blob/main/notebooks/benchmarking.py>`_.
*CapyMOA has the speed of MOA with the flexibility of Python and the richness of
Python's data science ecosystem.*
# 3. Success!
print(f"Accuracy: {results.accuracy():.2f}%")

📖 Cite Us
--------------
Next, we recomend the :ref:`tutorials`.

If you use CapyMOA in your research, please cite us using the following Bibtex entry::

Expand All @@ -89,57 +79,30 @@ If you use CapyMOA in your research, please cite us using the following Bibtex e
url={https://arxiv.org/abs/2502.07432}
}

.. _installation:

🚀 Installation
---------------

Installation instructions for CapyMOA:

.. toctree::
:maxdepth: 2

installation
docker

🎓 Tutorials
------------
Tutorials to help you get started with CapyMOA.

.. toctree::
:maxdepth: 2

tutorials

📚 Reference Manual
-------------------
Reference documentation describing the interfaces fo specific classes, functions,
and modules.

.. toctree::
:maxdepth: 2

api/index

ℹ️ About us
-----------

.. toctree::
about
.. figure:: /images/arf100_cpu_time.png
:alt: Performance plot
:align: center
:class: only-light

🏗️ Contributing
---------------
This part of the documentation is for developers and contributors.
Benchmark comparing CapyMOA against other data stream libraries [#f1]_.

.. toctree::
:maxdepth: 2
.. figure:: /images/arf100_cpu_time_dark.png
:alt: Performance plot
:align: center
:class: only-dark

contributing/index
Benchmark comparing CapyMOA against other data stream libraries [#f1]_.

.. warning::

Indices and tables
==================
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
on the `GitHub Issues <https://github.com/adaptive-machine-learning/CapyMOA/issues>`_
page or talk to us on `Discord <https://discord.gg/spd2gQJGAb>`_.

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
.. [#f1]
Benchmark comparing CapyMOA against other data stream libraries. The benchmark was
performed using an ensemble of 100 ARF learners trained on
:class:`capymoa.datasets.RTG_2abrupt` dataset containing 100,000 samples and 30
features. You can find the code to reproduce this benchmark in
`benchmarking.py <https://github.com/adaptive-machine-learning/CapyMOA/blob/main/notebooks/benchmarking.py>`_.
Loading
Loading