Skip to main content

Estimator for Normalized Mutual Information

Project description

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 will be published soon as:

Adaptive Entropy-Based Normalization for (High-Dimensional) Mutual Information
D. Nagel, G. Diez, and G. Stock, in prep.

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

normi-0.2.0.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

normi-0.2.0-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file normi-0.2.0.tar.gz.

File metadata

  • Download URL: normi-0.2.0.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for normi-0.2.0.tar.gz
Algorithm Hash digest
SHA256 1e8aab7b66c370b4933cc394279ea2f8ee209c3724c121f681fa7ebf6a68af96
MD5 1842c318387175038cfb6f572df937a2
BLAKE2b-256 2f2ebb353c04226c4acf51c566d70d9b2de6394335f296842ce852dbb8cbfb95

See more details on using hashes here.

File details

Details for the file normi-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: normi-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for normi-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 38b0bbbe131d1a61564e87fb551dcfdfe1b3ae662159b6f3dbf7e4a5a123b960
MD5 7651331b3eb27774cf2965cb22029a4a
BLAKE2b-256 665587bdd0ab5cf3559b9623217fea1dc9bb44e84e3b415871291a51d0d2cf57

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page