Class Entropy
java.lang.Object
es.uam.eps.ir.relison.utils.indexes.Entropy
public class Entropy
extends java.lang.Object
Computes the entropy of a series.
Reference: C.E. Shannon. A mathematical theory of communication. Bell System Technical Jorunal 27, pp. 379-423 and pp. 623-656 (1948)
-
Constructor Summary
Constructors Constructor Description Entropy()
-
Method Summary
Modifier and Type Method Description double
compute(java.util.List<java.lang.Double> values, double sumValues)
Computes the entropy of a series of valuesdouble
compute(java.util.Map<java.lang.Double,java.lang.Integer> map)
Optimized version of the entropy, that allows repeated values.double
compute(java.util.stream.Stream<java.lang.Double> values, double sumValues)
Computes the entropy of a series of values
-
Constructor Details
-
Entropy
public Entropy()
-
-
Method Details
-
compute
public double compute(java.util.List<java.lang.Double> values, double sumValues)Computes the entropy of a series of values- Parameters:
values
- A list of valuessumValues
- The sum of the values- Returns:
- the entropy
-
compute
public double compute(java.util.stream.Stream<java.lang.Double> values, double sumValues)Computes the entropy of a series of values- Parameters:
values
- A stream of valuessumValues
- The sum of the values- Returns:
- the entropy
-
compute
public double compute(java.util.Map<java.lang.Double,java.lang.Integer> map)Optimized version of the entropy, that allows repeated values.- Parameters:
map
- a map containing values as keys, and number of times a value is retrieved as values.- Returns:
- the entropy
-