Class MultiLabelMetric
java.lang.Object
org.tribuo.multilabel.evaluation.MultiLabelMetric
- All Implemented Interfaces:
EvaluationMetric<MultiLabel, org.tribuo.multilabel.evaluation.MultiLabelMetric.Context>
public class MultiLabelMetric
extends Object
implements EvaluationMetric<MultiLabel, org.tribuo.multilabel.evaluation.MultiLabelMetric.Context>
A
EvaluationMetric for evaluating MultiLabel problems.
The sufficient statistics used must be held in a ConfusionMatrix.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.tribuo.evaluation.metrics.EvaluationMetric
EvaluationMetric.Average -
Constructor Summary
ConstructorsConstructorDescriptionMultiLabelMetric(MetricTarget<MultiLabel> target, String name, BiFunction<MetricTarget<MultiLabel>, org.tribuo.multilabel.evaluation.MultiLabelMetric.Context, Double> impl) Constructs a multi-label metric. -
Method Summary
Modifier and TypeMethodDescriptiondoublecompute(org.tribuo.multilabel.evaluation.MultiLabelMetric.Context context) Compute the result of this metric from the input context.org.tribuo.multilabel.evaluation.MultiLabelMetric.ContextcreateContext(Model<MultiLabel> model, List<Prediction<MultiLabel>> 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
-
MultiLabelMetric
public MultiLabelMetric(MetricTarget<MultiLabel> target, String name, BiFunction<MetricTarget<MultiLabel>, org.tribuo.multilabel.evaluation.MultiLabelMetric.Context, Double> impl) Constructs a multi-label metric.- Parameters:
target- The metric target.name- The name of the metric.impl- The implementing function for this metric.
-
-
Method Details
-
getTarget
Description copied from interface:EvaluationMetricThe target for this metric instance.- Specified by:
getTargetin interfaceEvaluationMetric<MultiLabel, org.tribuo.multilabel.evaluation.MultiLabelMetric.Context>- Returns:
- The metric target.
-
getName
Description copied from interface:EvaluationMetricThe name of this metric.- Specified by:
getNamein interfaceEvaluationMetric<MultiLabel, org.tribuo.multilabel.evaluation.MultiLabelMetric.Context>- Returns:
- The name.
-
compute
public double compute(org.tribuo.multilabel.evaluation.MultiLabelMetric.Context context) Description copied from interface:EvaluationMetricCompute the result of this metric from the input context.- Specified by:
computein interfaceEvaluationMetric<MultiLabel, org.tribuo.multilabel.evaluation.MultiLabelMetric.Context>- Parameters:
context- The context to use.- Returns:
- The value of the metric.
-
toString
-
equals
-
hashCode
-
createContext
public org.tribuo.multilabel.evaluation.MultiLabelMetric.Context createContext(Model<MultiLabel> model, List<Prediction<MultiLabel>> predictions) Description copied from interface:EvaluationMetricCreates the context this metric uses to compute it's value.- Specified by:
createContextin interfaceEvaluationMetric<MultiLabel, org.tribuo.multilabel.evaluation.MultiLabelMetric.Context>- Parameters:
model- The model to use.predictions- The predictions to use.- Returns:
- The metric context.
-