minfo
Mutual information estimator with adaptive partitioning algorithm (C++/OpenMP accelerated).
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
Repository
Mutual information estimator with adaptive partitioning algorithm (C++/OpenMP accelerated).
Basic Info
Statistics
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 2
- Releases: 0
Topics
Metadata Files
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-devMacOS: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
- Darbellay, G. A., & Vajda, I. (1999). Estimation of the information by an adaptive partitioning of the observation space. IEEE Transactions on Information Theory, 45(4), 1315-1321.
```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
- Website: https://neoneuron.github.io
- Repositories: 34
- Profile: https://github.com/NeoNeuron
🧠 🖥️ 🌐 PhD Candidate for Applied Mathematics, Computational Neuroscientist @LCNS-SJTU
GitHub Events
Total
Last Year
Committers
Last synced: over 2 years ago
Top Committers
| Name | 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
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
Rankings
Maintainers (1)
Dependencies
- cython *
- numba *
- numpy *
- cython *
- numba *
- numpy *
- actions/checkout v2 composite
- conda-incubator/setup-miniconda v2 composite