minfo

Mutual information estimator with adaptive partitioning algorithm (C++/OpenMP accelerated).

https://github.com/neoneuron/minfo

Science Score: 10.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: ieee.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.2%) to scientific vocabulary

Keywords

cython mutual-information numba openmp-parallelization python
Last synced: 6 months ago · JSON representation

Repository

Mutual information estimator with adaptive partitioning algorithm (C++/OpenMP accelerated).

Basic Info
  • Host: GitHub
  • Owner: NeoNeuron
  • License: mit
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 216 KB
Statistics
  • Stars: 8
  • Watchers: 1
  • Forks: 0
  • Open Issues: 2
  • Releases: 0
Topics
cython mutual-information numba openmp-parallelization python
Created almost 6 years ago · Last pushed about 3 years ago
Metadata Files
Readme License

README.md

Mutual Information Estimator

Python-based mutual information estimator, designed for multiple data types.

Prerequisite

```bash

Make sure install numpy using conda.

Installation with pip may lead to unexpected errors.

conda install numpy cython numba ```

Install OpenMP Library \ Install OpenMP Library to enable CPU parallel acceleration for Time-delayed Mutual Information calculation.

Linux: sudo apt-get install libomp-dev MacOS: brew install libomp

Installation

To install via pip:

bash pip install minfo

To install via repository:

bash git clone https://github.com/NeoNeuron/minfo cd minfo pip install -e .

Get Started

MI with uniform bins

```python from minfo.mifloat import mutualinfo, TDMI

mutual_info : mutual information estimator

tdmi : time-delayed mutual information estimator

n = 100 x = np.random.rand(n) y = np.random.rand(n)

compute mutual information

mutual_info(x,y, bins=50) # default algorithm: 'uniform'

compute time-delayed mutual information (Parallel accelerated)

ndelay = 10 TDMI(x, y, ndelay, bins=50) # default algorithm: 'uniform' ```

MI with adaptive bins

ATTENTION: This algorithm is designed for mutual information estimation between continuous variables. Applying it to discrete variables with few number of values might lead to large deviations. Modules for finite discrete cases are to be developed.

Reference

```python from minfo.mifloat import mutualinfo, TDMI

mutual_info : mutual information estimator

tdmi : time-delayed mutual information estimator

n = 100 x = np.random.rand(n) y = np.random.rand(n)

compute mutual information

mutual_info(x,y, algorithm='adaptive')

compute time-delayed mutual information (Parallel accelerated)

ndelay = 10 TDMI(x, y, ndelay, algorithm='adaptive') ```

Compare performance with pure Python version

Test OS info: - Laptop: MacBook Pro (15-inch, 2018) - System version: macOS Big Sur 12.4 (21F79) - CPU: 2.6 GHz 6-Core Intel Core i7 - RAM: 32 GB 2400 MHz DDR4

bash $ cd example $ python example.py [INFO]: mi_adaptive (python) takes 0.025 s [INFO]: mi_uniform (numba) takes 0.000 s [INFO]: mi_adaptive (cython) takes 0.009 s [INFO]: tdmi_adaptive (python) takes 0.560 s [INFO]: tdmi_uniform (numba) takes 0.005 s [INFO]: tdmi_adaptive (cython) takes 0.076 s

Owner

  • Name: Kai Chen
  • Login: NeoNeuron
  • Kind: user
  • Location: Shanghai, China
  • Company: Shanghai Jiao Tong University

🧠 🖥️ 🌐 PhD Candidate for Applied Mathematics, Computational Neuroscientist @LCNS-SJTU

GitHub Events

Total
Last Year

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 40
  • Total Committers: 2
  • Avg Commits per committer: 20.0
  • Development Distribution Score (DDS): 0.175
Past Year
  • Commits: 2
  • Committers: 1
  • Avg Commits per committer: 2.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Kyle Chen N****n 33
Kyle Chen k****3@o****m 7

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 4
  • Total pull requests: 0
  • Average time to close issues: 3 months
  • Average time to close pull requests: N/A
  • Total issue authors: 4
  • Total pull request authors: 0
  • Average comments per issue: 0.5
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • LIUJAING (1)
  • NeoNeuron (1)
  • lyelibi (1)
  • ddm-j (1)
Pull Request Authors
Top Labels
Issue Labels
bug (2)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 18 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 4
  • Total maintainers: 1
pypi.org: minfo

Python-based mutual information estimator, designed for multiple data types.

  • Homepage: https://github.com/NeoNeuron/minfo
  • Documentation: https://minfo.readthedocs.io/
  • License: MIT License Copyright (c) 2022 Kai Chen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  • Latest release: 0.0.7
    published about 3 years ago
  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 18 Last month
Rankings
Dependent packages count: 10.0%
Stargazers count: 19.3%
Dependent repos count: 21.7%
Average: 23.6%
Forks count: 29.8%
Downloads: 37.3%
Maintainers (1)
Last synced: 6 months ago

Dependencies

requirements.txt pypi
  • cython *
  • numba *
  • numpy *
setup.py pypi
  • cython *
  • numba *
  • numpy *
.github/workflows/build.yml actions
  • actions/checkout v2 composite
  • conda-incubator/setup-miniconda v2 composite