Package smile.validation.metric
Class MutualInformation
java.lang.Object
smile.validation.metric.MutualInformation
- All Implemented Interfaces:
Serializable
,ClusteringMetric
Mutual Information for comparing clustering.
References
- X. Vinh, J. Epps, J. Bailey. Information Theoretic Measures for Clusterings Comparison: Variants, Properties, Normalization and Correction for Chance. JMLR, 2010.
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
-
Field Details
-
instance
Default instance.
-
-
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 interfaceClusteringMetric
- 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
-