Class MutualInformation

java.lang.Object
smile.validation.metric.MutualInformation
All Implemented Interfaces:
Serializable, ClusteringMetric

public class MutualInformation extends Object implements ClusteringMetric
Mutual Information for comparing clustering.

References

  1. X. Vinh, J. Epps, J. Bailey. Information Theoretic Measures for Clusterings Comparison: Variants, Properties, Normalization and Correction for Chance. JMLR, 2010.
See Also:
  • Field Details

  • Constructor Details

    • MutualInformation

      public MutualInformation()
  • Method Details

    • score

      public double score(int[] truth, int[] cluster)
      Description copied from interface: ClusteringMetric
      Returns a score to measure the quality of clustering.
      Specified by:
      score in interface ClusteringMetric
      Parameters:
      truth - the ground truth (or simply a clustering labels).
      cluster - the alternative cluster labels.
      Returns:
      the metric.
    • of

      public static double of(int[] truth, int[] cluster)
      Calculates the mutual information.
      Parameters:
      truth - the ground truth (or simply a clustering labels).
      cluster - the alternative cluster labels.
      Returns:
      the metric.
    • toString

      public String toString()
      Overrides:
      toString in class Object