One estimator model with two implementations and numerically matched results. Explore in Python, deploy the same measures in Rust.
$ pip install infomeasure$ cargo add infomeasureEvery measure is available through each approach, with bias-corrected variants where they exist, and divergences built on the same estimators.
Four estimator families, each paired with every measure. Discrete carries many bias-corrected MLE variants. Measures × estimators form a Cartesian product, with documented per-approach exceptions.
There are two packages. The Python package is the reference implementation, for notebooks, scripts and teaching. The Rust crate computes the same measures and is built for speed and deployment. Choose by how you work and where it runs.
| Python | Rust | |
|---|---|---|
| Where it fits | Notebooks and scripts, teaching, statistical tests, composite measures | Performance-critical code, portable binaries, embedding in services |
| Install | pip install infomeasure or conda install -c conda-forge infomeasure | cargo add infomeasure |
| Registry | PyPI and conda-forge | crates.io |
| Documentation | infomeasure.readthedocs.io | docs.rs/infomeasure |
| Acceleration | GPU via numba | Optional GPU (wgpu) and CPU threads (rayon) |
| Role | Reference implementation | Same estimators, parity-tested |
The API reads the same in both languages: choose a measure, choose an approach, read the value.
use infomeasure::estimators::entropy::Entropy; use infomeasure::estimators::traits::GlobalValue; let data = vec![1, 2, 1, 3, 2, 1]; let h = Entropy::new_discrete(data).global_value();
from infomeasure import entropy h = entropy([1, 2, 1, 3, 2, 1], approach="discrete")
On identical inputs, pinned to a single thread. Entropy runtime versus sample size for infomeasure-rs (solid) and the Python reference (dashed), by estimator family, lower is better.