Skip to main content

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.

Metadata

Release files for fast-mine 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fast-mine 0.1.0
File Size Uploaded
fast_mine-0.1.0.tar.gz 32.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fast-mine 0.1.0
File Interpreter ABI Platform
fast_mine-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 64.5 kB

Release files / fast_mine-0.1.0.tar.gz

Download URL fast_mine-0.1.0.tar.gz
Size 32.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3d2daab5167d36819bd8e75e3b89c65c02923c64a0139128c9d10f7ec2f7b2af
BLAKE2b-256 checksum
How to use checksums
bb1a65d97891bf7ea67b94988c962f3a261ff65fbf05b2964720f4be7a7903ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / fast_mine-0.1.0-py3-none-any.whl

Download URL fast_mine-0.1.0-py3-none-any.whl
Size 31.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2691b960a664d11587e49de60af766b983ccf91070fc05ae16962cc3c890b2e5
BLAKE2b-256 checksum
How to use checksums
de878fd5543a51422877b2feb8920ab74d4a2f8d812dde2641fc4d2de6066d62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page