be.ac.ulb.mlg.utils.measure
Class MutualInformation

java.lang.Object
  extended by be.ac.ulb.mlg.utils.measure.MutualInformation
All Implemented Interfaces:
Measure

public class MutualInformation
extends Object
implements Measure

Mutual information that use the entropy formula: I(X,Y) = H(X) - H(X|Y) = H(Y) - H(Y|X) = H(X) + H(Y) - H(X,Y)


Field Summary
 
Fields inherited from interface be.ac.ulb.mlg.utils.Measure
ERROR_VALUE
 
Constructor Summary
MutualInformation()
          The default constructor that uses the EmpiricalEntropy entropy estimator and no Discretizer
MutualInformation(Discretizer discretizer)
          The default constructor that uses the EmpiricalEntropy entropy estimator
MutualInformation(Entropy entropyEstimator)
          Constructor that uses the parameter entropy estimator and no discretizer
MutualInformation(Entropy entropyEstimator, Discretizer discretizer)
          Constructor that uses the parameter entropy estimator
 
Method Summary
 boolean hasNativeImplementation()
          Know if the measure owns a native implementation
 double measure(double[] A, double[] B, boolean[] computable)
          Compute the measure between two data vectors
 boolean requireDataTransformation()
          Know if the measure need to transform input data (input data are copied to be preserved)
 void transform(double[][] data)
          The transformation method called before measurement
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MutualInformation

public MutualInformation()
The default constructor that uses the EmpiricalEntropy entropy estimator and no Discretizer


MutualInformation

public MutualInformation(Discretizer discretizer)
The default constructor that uses the EmpiricalEntropy entropy estimator

Parameters:
discretizer - The discretrization method

MutualInformation

public MutualInformation(Entropy entropyEstimator)
Constructor that uses the parameter entropy estimator and no discretizer

Parameters:
entropyEstimator - The entropy estimator

MutualInformation

public MutualInformation(Entropy entropyEstimator,
                         Discretizer discretizer)
Constructor that uses the parameter entropy estimator

Parameters:
entropyEstimator - The entropy estimator
Method Detail

measure

public double measure(double[] A,
                      double[] B,
                      boolean[] computable)
Description copied from interface: Measure
Compute the measure between two data vectors

Specified by:
measure in interface Measure
Parameters:
A - The first data vector
B - The second data vector
computable - Boolean vector set to true except for indexes they must be ignored during the measurement
Returns:
The measure between a and b

hasNativeImplementation

public boolean hasNativeImplementation()
Description copied from interface: Measure
Know if the measure owns a native implementation

Specified by:
hasNativeImplementation in interface Measure
Returns:
True if the measure is also natively implemented

requireDataTransformation

public boolean requireDataTransformation()
Description copied from interface: Measure
Know if the measure need to transform input data (input data are copied to be preserved)

Specified by:
requireDataTransformation in interface Measure
Returns:
True if the input data require some transformation

transform

public void transform(double[][] data)
Description copied from interface: Measure
The transformation method called before measurement

Specified by:
transform in interface Measure
Parameters:
data - An input data vector to be measured