normi


Namenormi JSON
Version 0.2.0 PyPI version JSON
download
home_pagehttps://github.com/moldyn/NorMI
SummaryEstimator for Normalized Mutual Information
upload_time2024-03-11 14:48:51
maintainer
docs_urlNone
authorbraniii
requires_python>=3.8
licenseMIT License
keywords normalized mutual information mutual information kraskov estimator ksg estimator
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">
  
  <img class="lightmode" style="width: 500px;" src="https://github.com/moldyn/normi/blob/main/docs/hero.svg?raw=true#gh-light-mode-only" />

  <p>
    <a href="https://github.com/wemake-services/wemake-python-styleguide" alt="wemake-python-styleguide">
        <img src="https://img.shields.io/badge/style-wemake-000000.svg" /></a>
    <a href="https://beartype.rtfd.io" alt="bear-ified">
        <img src="https://raw.githubusercontent.com/beartype/beartype-assets/main/badge/bear-ified.svg" /></a>
    <a href="https://pypi.org/project/normi" alt="PyPI">
        <img src="https://img.shields.io/pypi/v/normi" /></a>
    <a href="https://anaconda.org/conda-forge/normi" alt="conda version">
	<img src="https://img.shields.io/conda/vn/conda-forge/normi" /></a>
    <a href="https://pepy.tech/project/normi" alt="Downloads">
        <img src="https://static.pepy.tech/badge/normi" /></a>
    <a href="https://github.com/moldyn/normi/actions/workflows/pytest.yml" alt="GitHub Workflow Status">
        <img src="https://img.shields.io/github/actions/workflow/status/moldyn/normi/pytest.yml?branch=main"></a>
    <a href="https://codecov.io/gh/moldyn/normi" alt="Code coverage">
        <img src="https://codecov.io/gh/moldyn/normi/branch/main/graph/badge.svg?token=KNWDAUXIGI" /></a>
    <a href="https://github.com/moldyn/normi/actions/workflows/codeql.yml" alt="CodeQL">
        <img src="https://github.com/moldyn/normi/actions/workflows/codeql.yml/badge.svg?branch=main" /></a>
    <a href="https://img.shields.io/pypi/pyversions/normi" alt="PyPI - Python Version">
        <img src="https://img.shields.io/pypi/pyversions/normi" /></a>
    <a href="https://moldyn.github.io/normi" alt="Docs">
        <img src="https://img.shields.io/badge/MkDocs-Documentation-brightgreen" /></a>
    <a href="https://github.com/moldyn/normi/blob/main/LICENSE" alt="License">
        <img src="https://img.shields.io/github/license/moldyn/normi" /></a>
  </p>

  <p>
    <a href="https://moldyn.github.io/NorMI">Docs</a> •
    <a href="#features">Features</a> •
    <a href="#installation">Installation</a> •
    <a href="#usage">Usage</a> •
    <a href="https://moldyn.github.io/NorMI/faq">FAQ</a>
  </p>
</div>

# 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](#module---inside-a-python-script) and via [CI](#ci---usage-directly-from-the-command-line)
- 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](https://moldyn.github.io/NorMI) and detailed discussion in publication

## Installation
The package is called `normi` and is available via [PyPI](https://pypi.org/project/normi) or [conda](https://anaconda.org/conda-forge/normi). To install it, simply call:
```bash
python3 -m pip install --upgrade normi
```
or
```
conda install -c conda-forge normi
```
or for the latest dev version
```bash
# 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](https://click.palletsprojects.com/en/8.0.x/shell-completion).
In the case of bash you need to add following line to your `~/.bashrc`
```bash
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](https://click.palletsprojects.com).
For a complete list of all options please see the
[docs](https://moldyn.github.io/NorMI/reference/cli/).
```bash
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
```python
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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/moldyn/NorMI",
    "name": "normi",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "normalized mutual information,mutual information,Kraskov Estimator,KSG Estimator",
    "author": "braniii",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/2f/2e/bb353c04226c4acf51c566d70d9b2de6394335f296842ce852dbb8cbfb95/normi-0.2.0.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n  \n  <img class=\"lightmode\" style=\"width: 500px;\" src=\"https://github.com/moldyn/normi/blob/main/docs/hero.svg?raw=true#gh-light-mode-only\" />\n\n  <p>\n    <a href=\"https://github.com/wemake-services/wemake-python-styleguide\" alt=\"wemake-python-styleguide\">\n        <img src=\"https://img.shields.io/badge/style-wemake-000000.svg\" /></a>\n    <a href=\"https://beartype.rtfd.io\" alt=\"bear-ified\">\n        <img src=\"https://raw.githubusercontent.com/beartype/beartype-assets/main/badge/bear-ified.svg\" /></a>\n    <a href=\"https://pypi.org/project/normi\" alt=\"PyPI\">\n        <img src=\"https://img.shields.io/pypi/v/normi\" /></a>\n    <a href=\"https://anaconda.org/conda-forge/normi\" alt=\"conda version\">\n\t<img src=\"https://img.shields.io/conda/vn/conda-forge/normi\" /></a>\n    <a href=\"https://pepy.tech/project/normi\" alt=\"Downloads\">\n        <img src=\"https://static.pepy.tech/badge/normi\" /></a>\n    <a href=\"https://github.com/moldyn/normi/actions/workflows/pytest.yml\" alt=\"GitHub Workflow Status\">\n        <img src=\"https://img.shields.io/github/actions/workflow/status/moldyn/normi/pytest.yml?branch=main\"></a>\n    <a href=\"https://codecov.io/gh/moldyn/normi\" alt=\"Code coverage\">\n        <img src=\"https://codecov.io/gh/moldyn/normi/branch/main/graph/badge.svg?token=KNWDAUXIGI\" /></a>\n    <a href=\"https://github.com/moldyn/normi/actions/workflows/codeql.yml\" alt=\"CodeQL\">\n        <img src=\"https://github.com/moldyn/normi/actions/workflows/codeql.yml/badge.svg?branch=main\" /></a>\n    <a href=\"https://img.shields.io/pypi/pyversions/normi\" alt=\"PyPI - Python Version\">\n        <img src=\"https://img.shields.io/pypi/pyversions/normi\" /></a>\n    <a href=\"https://moldyn.github.io/normi\" alt=\"Docs\">\n        <img src=\"https://img.shields.io/badge/MkDocs-Documentation-brightgreen\" /></a>\n    <a href=\"https://github.com/moldyn/normi/blob/main/LICENSE\" alt=\"License\">\n        <img src=\"https://img.shields.io/github/license/moldyn/normi\" /></a>\n  </p>\n\n  <p>\n    <a href=\"https://moldyn.github.io/NorMI\">Docs</a> \u2022\n    <a href=\"#features\">Features</a> \u2022\n    <a href=\"#installation\">Installation</a> \u2022\n    <a href=\"#usage\">Usage</a> \u2022\n    <a href=\"https://moldyn.github.io/NorMI/faq\">FAQ</a>\n  </p>\n</div>\n\n# NorMI: Nonparametric Normalized Mutual Information Estimator Based on *k*-NN Statistics\nThis software provides an extension to the Kraskov-Estimator to allow normalizing the mutual information.\n\nThe method will be published soon as:\n> **Adaptive Entropy-Based Normalization for (High-Dimensional) Mutual Information**  \n> D. Nagel, G. Diez, and G. Stock,  in prep.\n\nIf you use this software package, please cite the above mentioned paper.\n\n## Features\n- Intuitive usage via [module](#module---inside-a-python-script) and via [CI](#ci---usage-directly-from-the-command-line)\n- Sklearn-style API for fast integration into your Python workflow\n- No magic, only a  single parameter which can be optimized via cross-validation\n- Extensive [documentation](https://moldyn.github.io/NorMI) and detailed discussion in publication\n\n## Installation\nThe package is called `normi` and is available via [PyPI](https://pypi.org/project/normi) or [conda](https://anaconda.org/conda-forge/normi). To install it, simply call:\n```bash\npython3 -m pip install --upgrade normi\n```\nor\n```\nconda install -c conda-forge normi\n```\nor for the latest dev version\n```bash\n# via ssh key\npython3 -m pip install git+ssh://git@github.com/moldyn/NorMI.git\n\n# or via password-based login\npython3 -m pip install git+https://github.com/moldyn/NorMI.git\n```\n\n### Shell Completion\nUsing the `bash`, `zsh` or `fish` shell click provides an easy way to provide shell completion, checkout the [docs](https://click.palletsprojects.com/en/8.0.x/shell-completion).\nIn the case of bash you need to add following line to your `~/.bashrc`\n```bash\neval \"$(_NORMI_COMPLETE=bash_source normi)\"\n```\n\n## Usage\nIn 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.\n\n### CI - Usage Directly from the Command Line\nThe module brings a rich CI using [click](https://click.palletsprojects.com).\nFor a complete list of all options please see the\n[docs](https://moldyn.github.io/NorMI/reference/cli/).\n```bash\npython -m normi /\n  --input input_file  / # ascii file of shape (n_samples, n_features)\n  --output output_file  / # creates ascii file of shape (n_features, n_features)\n  --n-dims / # this allows to treat every n_dims columns as a high dimensional feature\n  --verbose\n\n```\n\n### Module - Inside a Python Script\n```python\nfrom normi import NormalizedMI\n\n# Load file\n# X is np.ndarray of shape (n_samples, n_features)\n\nnmi = NormalizedMI()\nnmi_matrix = nmi.fit_transform(X)\n...\n```\n\n## Credits\n\n- Logo generated with DALL\u00b7E 3 by @gegabo\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Estimator for Normalized Mutual Information",
    "version": "0.2.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/moldyn/NorMI/issues",
        "Changelog": "https://moldyn.github.io/NorMI/changelog",
        "Documentation": "https://moldyn.github.io/NorMI",
        "Homepage": "https://github.com/moldyn/NorMI",
        "Source Code": "https://github.com/moldyn/NorMI"
    },
    "split_keywords": [
        "normalized mutual information",
        "mutual information",
        "kraskov estimator",
        "ksg estimator"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "665587bdd0ab5cf3559b9623217fea1dc9bb44e84e3b415871291a51d0d2cf57",
                "md5": "7651331b3eb27774cf2965cb22029a4a",
                "sha256": "38b0bbbe131d1a61564e87fb551dcfdfe1b3ae662159b6f3dbf7e4a5a123b960"
            },
            "downloads": -1,
            "filename": "normi-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7651331b3eb27774cf2965cb22029a4a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 12270,
            "upload_time": "2024-03-11T14:48:50",
            "upload_time_iso_8601": "2024-03-11T14:48:50.169260Z",
            "url": "https://files.pythonhosted.org/packages/66/55/87bdd0ab5cf3559b9623217fea1dc9bb44e84e3b415871291a51d0d2cf57/normi-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2f2ebb353c04226c4acf51c566d70d9b2de6394335f296842ce852dbb8cbfb95",
                "md5": "1842c318387175038cfb6f572df937a2",
                "sha256": "1e8aab7b66c370b4933cc394279ea2f8ee209c3724c121f681fa7ebf6a68af96"
            },
            "downloads": -1,
            "filename": "normi-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "1842c318387175038cfb6f572df937a2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 16081,
            "upload_time": "2024-03-11T14:48:51",
            "upload_time_iso_8601": "2024-03-11T14:48:51.653649Z",
            "url": "https://files.pythonhosted.org/packages/2f/2e/bb353c04226c4acf51c566d70d9b2de6394335f296842ce852dbb8cbfb95/normi-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-11 14:48:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "moldyn",
    "github_project": "NorMI",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "normi"
}
        
Elapsed time: 0.21000s