com.github.TKnudsen.ComplexDataObject.model.statistics.test.EntropyTest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of complex-data-object Show documentation
Show all versions of complex-data-object Show documentation
A library that models real-world objects in Java, referred to as ComplexDataObjects. Other features: IO and preprocessing of ComplexDataObjects.
The newest version!
package com.github.TKnudsen.ComplexDataObject.model.statistics.test;
import java.util.ArrayList;
import java.util.Collection;
import com.github.TKnudsen.ComplexDataObject.model.statistics.Entropy;
/**
*
* Copyright: Copyright (c) 2016-2019
*
*
* @author Juergen Bernard
* @version 1.01
*/
public class EntropyTest {
public static void main(String args[]) {
Collection distribution = new ArrayList();
distribution.add(0.3);
distribution.add(0.2);
distribution.add(0.2);
distribution.add(0.2);
distribution.add(0.2);
System.out.println("Entropy: " + Entropy.calculateEntropy(distribution));
}
}