be.ac.ulb.mlg.utils.measure.entropy
Class EmpiricalEntropy
java.lang.Object
be.ac.ulb.mlg.utils.measure.Entropy
be.ac.ulb.mlg.utils.measure.entropy.EmpiricalEntropy
- All Implemented Interfaces:
- Measure
- Direct Known Subclasses:
- ShannonEntropy
public class EmpiricalEntropy
- extends Entropy
The classic empirical entropy estimate of Uniform probability distribution.
Constructor Summary |
EmpiricalEntropy()
Constructor with no pseudo count |
EmpiricalEntropy(double pseudoCount)
Constructor that use a pseudo count value added to occurrences |
Method Summary |
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 |
EmpiricalEntropy
public EmpiricalEntropy()
- Constructor with no pseudo count
EmpiricalEntropy
public EmpiricalEntropy(double pseudoCount)
- Constructor that use a pseudo count value added to occurrences
- Parameters:
pseudoCount
- The pseudo count value
entropy
public double entropy(double[] frequencies,
int distinctValues,
int numberOfValues)
- Description copied from class:
Entropy
- Compute the entropy of a vector of values (non missing values (NaN))
- Specified by:
entropy
in class Entropy
- Parameters:
frequencies
- The occurrences array (of values)distinctValues
- The number of distinct valuesnumberOfValues
- The number of values
- Returns:
- The pseudo count
hasNativeImplementation
public boolean hasNativeImplementation()
- Description copied from interface:
Measure
- Know if the measure owns a native implementation
- Specified by:
hasNativeImplementation
in interface Measure
- Overrides:
hasNativeImplementation
in class Entropy
- Returns:
- True if the measure is also natively implemented