public class ClusteringMetric extends Object implements EvaluationMetric<ClusterID,org.tribuo.clustering.evaluation.ClusteringMetric.Context>
EvaluationMetric.Average
Constructor and Description |
---|
ClusteringMetric(MetricTarget<ClusterID> target,
String name,
BiFunction<MetricTarget<ClusterID>,org.tribuo.clustering.evaluation.ClusteringMetric.Context,Double> impl) |
Modifier and Type | Method and Description |
---|---|
double |
compute(org.tribuo.clustering.evaluation.ClusteringMetric.Context context)
Compute the result of this metric from the input context.
|
org.tribuo.clustering.evaluation.ClusteringMetric.Context |
createContext(Model<ClusterID> model,
List<Prediction<ClusterID>> predictions)
Creates the context this metric uses to compute it's value.
|
String |
getName()
The name of this metric.
|
MetricTarget<ClusterID> |
getTarget()
The target for this metric instance.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createContext, getID
public ClusteringMetric(MetricTarget<ClusterID> target, String name, BiFunction<MetricTarget<ClusterID>,org.tribuo.clustering.evaluation.ClusteringMetric.Context,Double> impl)
public double compute(org.tribuo.clustering.evaluation.ClusteringMetric.Context context)
EvaluationMetric
compute
in interface EvaluationMetric<ClusterID,org.tribuo.clustering.evaluation.ClusteringMetric.Context>
context
- The context to use.public MetricTarget<ClusterID> getTarget()
EvaluationMetric
getTarget
in interface EvaluationMetric<ClusterID,org.tribuo.clustering.evaluation.ClusteringMetric.Context>
public String getName()
EvaluationMetric
getName
in interface EvaluationMetric<ClusterID,org.tribuo.clustering.evaluation.ClusteringMetric.Context>
public org.tribuo.clustering.evaluation.ClusteringMetric.Context createContext(Model<ClusterID> model, List<Prediction<ClusterID>> predictions)
EvaluationMetric
createContext
in interface EvaluationMetric<ClusterID,org.tribuo.clustering.evaluation.ClusteringMetric.Context>
model
- The model to use.predictions
- The predictions to use.Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.