Enum ClusteringMetrics
- All Implemented Interfaces:
Serializable
,Comparable<ClusteringMetrics>
,java.lang.constant.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 ConstantsEnum 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) BiFunction
<MetricTarget<ClusterID>, org.tribuo.clustering.evaluation.ClusteringMetric.Context, Double> getImpl()
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 type with the specified name.static ClusteringMetrics[]
values()
Returns an array containing the constants of this enum type, 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 type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
getImpl
public BiFunction<MetricTarget<ClusterID>, org.tribuo.clustering.evaluation.ClusteringMetric.Context, Double> getImpl() -
forTarget
-
adjustedMI
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.
-