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 values
    double 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • 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 values
      sumValues - 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 values
      sumValues - 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