Enum Class ClusteringMetrics

java.lang.Object
java.lang.Enum<ClusteringMetrics>
org.tribuo.clustering.evaluation.ClusteringMetrics
All Implemented Interfaces:
Serializable, Comparable<ClusteringMetrics>, Constable

public enum ClusteringMetrics extends Enum<ClusteringMetrics>
Default metrics for evaluating clusterings.
  • Enum Constant Details

    • NORMALIZED_MI

      public static final ClusteringMetrics NORMALIZED_MI
      The normalized mutual information between the two clusterings
    • ADJUSTED_MI

      public static final ClusteringMetrics ADJUSTED_MI
      The normalized mutual information adjusted for chance.
  • Method Details

    • values

      public static ClusteringMetrics[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ClusteringMetrics valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getImpl

      public BiFunction<MetricTarget<ClusterID>,org.tribuo.clustering.evaluation.ClusteringMetric.Context,Double> getImpl()
      Gets the implementing function for this metric.
      Returns:
      The implementing function.
    • forTarget

      public ClusteringMetric forTarget(MetricTarget<ClusterID> tgt)
      Constructs the metric for the specified metric target.
      Parameters:
      tgt - The metric target.
      Returns:
      The clustering metric for that target.
    • adjustedMI

      public static double adjustedMI(org.tribuo.clustering.evaluation.ClusteringMetric.Context context)
      Calculates the adjusted normalized mutual information between two clusterings.
      Parameters:
      context - The context containing the predicted clustering and the ground truth.
      Returns:
      The adjusted normalized mutual information.
    • adjustedMI

      public static double adjustedMI(List<Integer> predictedIDs, List<Integer> trueIDs)
      Calculates the adjusted normalized mutual information between two clusterings.
      Parameters:
      predictedIDs - The predicted cluster ids.
      trueIDs - The ground truth cluster ids.
      Returns:
      The adjusted normalized mutual information.
    • normalizedMI

      public static double normalizedMI(org.tribuo.clustering.evaluation.ClusteringMetric.Context context)
      Calculates the normalized mutual information between two clusterings.
      Parameters:
      context - The context containing the predicted clustering and the ground truth.
      Returns:
      The normalized mutual information.