Python API

class minepy.MINE(alpha=0.6, c=15)

Maximal Information-based Nonparametric Exploration.

Parameters :
alpha : float (0, 1.0]

the exponent in B(n) = n^alpha

c : float (> 0)

determines how many more clumps there will be than columns in every partition. Default value is 15, meaning that when trying to draw Gx grid lines on the x-axis, the algorithm will start with at most 15*Gx clumps

score(x, y)

Computes the maximum normalized mutual information scores (I).

mic()

Returns the Maximal Information Coefficient (MIC).

mas()

Returns the Maximum Asymmetry Score (MAS).

mev()

Returns the Maximum Edge Value (MEV).

mcn()

Returns the Minimum Cell Number (MCN).

get_score()

Returns the maximum normalized mutual information scores.

I is a list of 1d numpy arrays where I[i][j] contains the score using a grid partitioning x-values into j+2 bins and y-values into i+2 bins.

get_alpha()

Returns alpha.

get_c()

Returns c.

computed()

Return true if the score is computed.

Example

>>> import numpy as np
>>> from minepy import MINE
>>> x = np.linspace(0, 1, 1000)
>>> y = np.sin(10 * np.pi * x) + x
>>> mine = MINE(alpha=0.6, c=15)
>>> mine.score(x, y)
>>> mine.mic()
1.0
>>> np.random.seed(0)
>>> y +=np.random.uniform(-1, 1, x.shape[0]) # add some noise
>>> mine.score(x, y)
>>> mine.mic()
0.50571669341737124

Table Of Contents

Previous topic

C++ API

Next topic

MATLAB and OCTAVE API

This Page