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

java.lang.Object
  extended by be.ac.ulb.mlg.utils.measure.Entropy
All Implemented Interfaces:
Measure
Direct Known Subclasses:
DirichletEntropy, EmpiricalEntropy

public abstract class Entropy
extends Object
implements Measure

Abstract class of entropy that need to use an estimator. The measure function of the Measure interface computes the joint entropy.


Field Summary
 
Fields inherited from interface be.ac.ulb.mlg.utils.Measure
ERROR_VALUE
 
Constructor Summary
Entropy()
           
 
Method Summary
 double entropy(double[] x)
          Compute the entropy of a vector of values (non missing values (NaN))
abstract  double entropy(double[] frequencies, int distinctValues, int numberOfValues)
          Compute the entropy of a vector of values (non missing values (NaN))
 boolean hasNativeImplementation()
          Know if the measure owns a native implementation
 double jointEntropy(double[] x, double[] y)
          Compute the joint entropy of two vectors of values x,y (non missing values (NaN))
 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

Entropy

public Entropy()
Method Detail

entropy

public abstract double entropy(double[] frequencies,
                               int distinctValues,
                               int numberOfValues)
Compute the entropy of a vector of values (non missing values (NaN))

Parameters:
frequencies - The occurrences array (of values)
distinctValues - The number of distinct values
numberOfValues - The number of values
Returns:
The pseudo count

jointEntropy

public double jointEntropy(double[] x,
                           double[] y)
Compute the joint entropy of two vectors of values x,y (non missing values (NaN))

Parameters:
x - The first vector of values
y - The second vector of values
Returns:
The joint entropy estimation

entropy

public double entropy(double[] x)
Compute the entropy of a vector of values (non missing values (NaN))

Parameters:
x - The vector of values
Returns:
The entropy estimation

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