Class InformationTheoryDemo
java.lang.Object
org.tribuo.util.infotheory.example.InformationTheoryDemo
Demo showing how to calculate various mutual informations and entropies.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Command line options.static enum
Type of data distribution. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongenerateCorrelated
(int length, int alphabetSize, double xyCorrelation, double xzCorrelation) These correlations don't map to mutual information values, as if xyDraw is above xyCorrelation then the draw is completely random.generateUniform
(int length, int alphabetSize) Generates a sample from a uniform distribution over the integers.generateXOR
(int length) Generates a sample from a three variable XOR function.static void
Runs a simple demo of the information theory functions.
-
Constructor Details
-
InformationTheoryDemo
public InformationTheoryDemo()
-
-
Method Details
-
generateUniform
Generates a sample from a uniform distribution over the integers.- Parameters:
length
- The number of samples.alphabetSize
- The alphabet size (i.e., the number of unique values).- Returns:
- A sample from a uniform distribution.
-
generateXOR
Generates a sample from a three variable XOR function.Each list is a binary variable, and the third is the XOR of the first two.
- Parameters:
length
- The number of samples.- Returns:
- A sample from an XOR function.
-
main
Runs a simple demo of the information theory functions.- Parameters:
args
- The CLI arguments.
-