Skip to main content

NorMI: Nonparametric Normalized Mutual Information Estimator Based on k-NN Statistics

This software provides an extension to the Kraskov-Estimator to allow normalizing the mutual information.

The method was published in:

Accurate estimation of the normalized mutual information of multidimensional data
D. Nagel, G. Diez, and G. Stock,
J. Chem. Phys. 2024 161, 054108
doi: 10.1063/5.0217960

If you use this software package, please cite the above mentioned paper.

Features

  • Intuitive usage via module and via CI
  • Sklearn-style API for fast integration into your Python workflow
  • No magic, only a single parameter which can be optimized via cross-validation
  • Extensive documentation and detailed discussion in publication

Installation

The package is called normi and is available via PyPI or conda. To install it, simply call:

python3 -m pip install --upgrade normi

or

conda install -c conda-forge normi

or for the latest dev version

# via ssh key
python3 -m pip install git+ssh://git@github.com/moldyn/NorMI.git

# or via password-based login
python3 -m pip install git+https://github.com/moldyn/NorMI.git

Shell Completion

Using the bash, zsh or fish shell click provides an easy way to provide shell completion, checkout the docs. In the case of bash you need to add following line to your ~/.bashrc

eval "$(_NORMI_COMPLETE=bash_source normi)"

Usage

In general one can call the module directly by its entry point $ normi or by calling the module $ python -m normi. The latter method is preferred to ensure using the desired python environment. For enabling the shell completion, the entry point needs to be used.

CI - Usage Directly from the Command Line

The module brings a rich CI using click. For a complete list of all options please see the docs.

python -m normi /
  --input input_file  / # ascii file of shape (n_samples, n_features)
  --output output_file  / # creates ascii file of shape (n_features, n_features)
  --n-dims / # this allows to treat every n_dims columns as a high dimensional feature
  --verbose

Module - Inside a Python Script

from normi import NormalizedMI

# Load file
# X is np.ndarray of shape (n_samples, n_features)

nmi = NormalizedMI()
nmi_matrix = nmi.fit_transform(X)
...

Credits

  • Logo generated with DALL·E 3 by @gegabo

Metadata

Release files for normi 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for normi 0.3.0
File Size Uploaded Provenance
normi-0.3.0.tar.gz 151.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for normi 0.3.0
File Interpreter ABI Platform
normi-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 163.7 kB

Release files / normi-0.3.0.tar.gz

Download URL normi-0.3.0.tar.gz
Size 151.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f19717d4c1665a602f1a7ca0e29bb81ef49e3ec3ebae1d011890837d3ab9eb00
BLAKE2b-256 checksum
How to use checksums
9629ab93aa8a35ad4d504c3ab28e761242b4c5c9ae76832ad7345faa17f969ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / normi-0.3.0-py3-none-any.whl

Download URL normi-0.3.0-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
364690f92cb0c7dff5bdc5f0d4cf4d70e96ec5accc0425bb4ad439a69d0002fe
BLAKE2b-256 checksum
How to use checksums
0c86c4e1f397f0743d85d62bfefed25cfd305376bbe8d990ec715b8e2ac01762
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for normi 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page