Class LabelMetric
java.lang.Object
org.tribuo.classification.evaluation.LabelMetric
- All Implemented Interfaces:
EvaluationMetric<Label, LabelMetric.Context>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThe context for aLabelMetricis aConfusionMatrix.Nested classes/interfaces inherited from interface org.tribuo.evaluation.metrics.EvaluationMetric
EvaluationMetric.Average -
Constructor Summary
ConstructorsConstructorDescriptionLabelMetric(MetricTarget<Label> tgt, String name, ToDoubleBiFunction<MetricTarget<Label>, LabelMetric.Context> impl) Construct a newLabelMetricfor the supplied metric target, using the supplied function. -
Method Summary
Modifier and TypeMethodDescriptiondoublecompute(LabelMetric.Context context) Compute the result of this metric from the input context.createContext(Model<Label> model, List<Prediction<Label>> predictions) Creates the context this metric uses to compute it's value.booleangetName()The name of this metric.The target for this metric instance.inthashCode()toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.tribuo.evaluation.metrics.EvaluationMetric
createContext, getID
-
Constructor Details
-
LabelMetric
public LabelMetric(MetricTarget<Label> tgt, String name, ToDoubleBiFunction<MetricTarget<Label>, LabelMetric.Context> impl) Construct a newLabelMetricfor the supplied metric target, using the supplied function.- Parameters:
tgt- The metric target.name- The name of the metric.impl- The implementing function.
-
-
Method Details
-
compute
Description copied from interface:EvaluationMetricCompute the result of this metric from the input context.- Specified by:
computein interfaceEvaluationMetric<Label, LabelMetric.Context>- Parameters:
context- The context to use.- Returns:
- The value of the metric.
-
getTarget
Description copied from interface:EvaluationMetricThe target for this metric instance.- Specified by:
getTargetin interfaceEvaluationMetric<Label, LabelMetric.Context>- Returns:
- The metric target.
-
getName
Description copied from interface:EvaluationMetricThe name of this metric.- Specified by:
getNamein interfaceEvaluationMetric<Label, LabelMetric.Context>- Returns:
- The name.
-
equals
-
hashCode
-
toString
-
createContext
Description copied from interface:EvaluationMetricCreates the context this metric uses to compute it's value.- Specified by:
createContextin interfaceEvaluationMetric<Label, LabelMetric.Context>- Parameters:
model- The model to use.predictions- The predictions to use.- Returns:
- The metric context.
-