A Numba-accelerated Python implementation of MINE (Maximal Information-based Nonparametric Exploration) statistics.
Project description
Fast-MINE
A Numba-accelerated Python implementation of MINE (Maximal Information-based Nonparametric Exploration) statistics, including MIC (Maximal Information Coefficient).
This package provides a drop-in replacement for the C-based minepy implementation, optimized for performance using JIT compilation via Numba.
The logic and algorithms in this package are derived from the original minepy implementation and the methodologies described in:
- David N. Reshef, Yakir A. Reshef, Hilary K. Finucane, et al. "Detecting Novel Associations in Large Data Sets." Science 334, 1518 (2011). DOI: 10.1126/science.1205438
- Davide Albanese, Michele Filosi, Roberto Visintainer, Samantha Riccadonna, Giuseppe Jurman, and Cesare Furlanello. "minerva and minepy: a C engine for the MINE suite and its R, Python and MATLAB wrappers." Bioinformatics (2012). DOI: 10.1093/bioinformatics/bts707
This project respects the original work and aims to provide a pure Python implementation for broader compatibility and ease of use in modern Python environments without requiring C compilation.
Features
- High Performance: Uses Numba to compile core algorithms to machine code, providing C-like performance.
- Pure Python compatible: Easy to install and modify.
- Algorithms:
- MIC (Maximal Information Coefficient): APPROX-MIC and MIC_e estimators.
- TIC (Total Information Coefficient)
- GMIC (Generalized Mean Information Coefficient)
- MAS (Maximum Asymmetry Score)
- MEV (Maximum Edge Value)
- MCN (Minimum Cell Number)
Installation
pip install .
Usage
import numpy as np
from fast_mine import mine_compute_score, MineParameter, MineProblem, mine_mic, EST_MIC_APPROX
# Generate data
x = np.linspace(0, 1, 100)
y = np.sin(10 * np.pi * x) + x
# Setup problem
prob = MineProblem(x=x, y=y, n=len(x))
param = MineParameter(alpha=0.6, c=15, est=EST_MIC_APPROX)
# Compute
score = mine_compute_score(prob, param)
# Get Statistics
print(f"MIC: {mine_mic(score)}")
Attribution & Acknowledgements
Example Datasets
Testing and verification for this library utilize datasets from the example-causal-datasets repository (CC0 1.0 Universal License).
We acknowledge the authors and contributors of the example-causal-datasets project for providing standardized real-world and synthetic datasets essential for benchmarking causal discovery and statistical association algorithms.
License
Based on minepy, this project is licensed under the GPL-3.0 License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fast_mine-0.1.0.tar.gz.
File metadata
- Download URL: fast_mine-0.1.0.tar.gz
- Upload date:
- Size: 32.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d2daab5167d36819bd8e75e3b89c65c02923c64a0139128c9d10f7ec2f7b2af
|
|
| MD5 |
acee436145b48c7420889e4ca2327d7e
|
|
| BLAKE2b-256 |
bb1a65d97891bf7ea67b94988c962f3a261ff65fbf05b2964720f4be7a7903ab
|
File details
Details for the file fast_mine-0.1.0-py3-none-any.whl.
File metadata
- Download URL: fast_mine-0.1.0-py3-none-any.whl
- Upload date:
- Size: 31.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2691b960a664d11587e49de60af766b983ccf91070fc05ae16962cc3c890b2e5
|
|
| MD5 |
dfb8433af53926770646d59a8da7eead
|
|
| BLAKE2b-256 |
de878fd5543a51422877b2feb8920ab74d4a2f8d812dde2641fc4d2de6066d62
|