Package org.tribuo.clustering.evaluation
Enum Class ClusteringMetrics
- All Implemented Interfaces:
Serializable
,Comparable<ClusteringMetrics>
,Constable
Default metrics for evaluating clusterings.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionThe normalized mutual information adjusted for chance.The normalized mutual information between the two clusterings -
Method Summary
Modifier and TypeMethodDescriptionstatic double
adjustedMI
(org.tribuo.clustering.evaluation.ClusteringMetric.Context context) Calculates the adjusted normalized mutual information between two clusterings.forTarget
(MetricTarget<ClusterID> tgt) Constructs the metric for the specified metric target.BiFunction<MetricTarget<ClusterID>,
org.tribuo.clustering.evaluation.ClusteringMetric.Context, Double> getImpl()
Gets the implementing function for this metric.static double
normalizedMI
(org.tribuo.clustering.evaluation.ClusteringMetric.Context context) Calculates the normalized mutual information between two clusterings.static ClusteringMetrics
Returns the enum constant of this class with the specified name.static ClusteringMetrics[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NORMALIZED_MI
The normalized mutual information between the two clusterings -
ADJUSTED_MI
The normalized mutual information adjusted for chance.
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
getImpl
public BiFunction<MetricTarget<ClusterID>,org.tribuo.clustering.evaluation.ClusteringMetric.Context, getImpl()Double> Gets the implementing function for this metric.- Returns:
- The implementing function.
-
forTarget
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.
-
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.
-