This repo implements the ROCKET time-series transform in Rust with Python bindings. Originally, ROCKET is implemented in Python.
Using the arrow-head dataset provided by aeon:
from aeon.datasets import load_arrow_head
from rocket_rs import transform
x, _ = load_arrow_head(split="train")
z = transform(x)- Install Python, e.g. using miniforge
- Install Rust
- Install maturin
- Create and activate Python virtual environment (e.g.
conda create -n rocket-rs python=3.11 && conda activate rocket-rs) - Run:
maturin develop --extras=dev
pre-commit install --install-hooks
python -m maturin_import_hook site install --args="--release"maturin developto re-build and install the editable development version (pip install --editable .)maturin buildto build the Rust package and Python wheelpytest --benchmark-skipto rebuild automatically usingmaturin_import_hookand run Python unit testspytest --benchmark-onlyto run benchmarks usingmaturin_import_hook
- separate kernel parameter generation from computation
- compare and test against Python implementation in aeon
- refactor to pass random generator to functions
- use debugger
- benchmark & improve
- For Python bindings for Rust, see https://github.com/PyO3/pyo3
- https://github.com/PyO3/maturin for packaging and publishing
- To use
poetrywithmaturin, see PyO3/maturin#1246 (comment) - For project layout using both Python and Rust, see https://www.maturin.rs/project_layout.html#mixed-rustpython-project, I preferred having separate folders for Rust and Python
- To generate GitHub Action, run
maturin generate-ci github - https://github.com/FL33TW00D/rustDTW
- https://github.com/PyO3/rust-numpy for integration between Python Numpy and Rust ndarray arrays
- https://www.aeon-toolkit.org/en/stable/examples/classification/classification.html
- https://github.com/projectsyn/reclass-rs and https://www.youtube.com/watch?v=N7GMHcX-WdA
- micro-benchmarking with https://github.com/bheisler/criterion.rs