There are two implementations of the same estimator model, and they produce the same numbers. infomeasure, the Python package, is the reference. infomeasure-rs, the Rust crate, is the compiled one. Neither is a subset of the other, so the choice is about your workflow and where the code runs, not about which measures you get.
Start from how you work
Choose Python when the work is exploratory or teaching oriented. The package installs from PyPI or conda-forge, works in notebooks and scripts, and offers the widest surface: statistical tests and composite measures on top of the estimators. Approach selection is by a string argument, which is convenient when the choice is made at runtime.
Choose Rust when the estimator is part of a larger program, when you want a single portable binary with no runtime, or when the input is large enough that the Python runtime becomes the bottleneck. The estimator is selected through the type system, so the choice is checked at compile time. Optional features add GPU evaluation and CPU parallelism without changing the API.
Start from your data
The estimator, not the language, usually decides the answer. The guides cover this in detail and the reasoning is the same in both packages.
- Discrete or categorical data. The plug-in estimator, with small-sample corrections such as Miller and Madow, Chao and Shen, Grassberger, James and Stein shrinkage, and NSB.
- Continuous data with a density. Kernel estimation with a box or Gaussian kernel, or the Kozachenko and Leonenko entropy and the Kraskov, Stoegbauer and Grassberger mutual information for nearest-neighbour estimation.
- Time series. Permutation or ordinal estimation, and delay-embedded transfer entropy.
- Generalized entropies. Renyi and Tsallis entropies and divergences, through the nearest-neighbour family.
Estimator selection guides:
Working across the two
The two packages are kept numerically aligned by continuous parity testing, so a result computed in one can be checked in the other. The Rust crate is also intended to serve as a compiled backend for the Python package, which would let existing Python code gain the speed without changing the workflow. That backend work is on the roadmap rather than released.
A short summary
| Choose Python if you want | Choose Rust if you want |
|---|---|
| Notebooks, teaching and exploratory analysis | The same measures inside a larger program or service |
| Statistical tests and composite measures | A portable binary with no runtime |
| The reference implementation to check against | GPU or multi-threaded estimation on large inputs |