Class LabelEvaluator
java.lang.Object
org.tribuo.evaluation.AbstractEvaluator<Label,LabelMetric.Context,LabelEvaluation,LabelMetric>
org.tribuo.classification.evaluation.LabelEvaluator
- All Implemented Interfaces:
Evaluator<Label,LabelEvaluation>
public final class LabelEvaluator
extends AbstractEvaluator<Label,LabelMetric.Context,LabelEvaluation,LabelMetric>
An
Evaluator for Labels.
The default set of metrics is taken from LabelMetrics. If the supplied
model generates probabilities, then it also calculates LabelMetrics.AUCROC and
LabelMetrics.AVERAGED_PRECISION.
If the dataset contains an unknown Label (as generated by LabelFactory.getUnknownOutput())
or a valid Label which is outside of the domain of the Model then the evaluate methods will
throw IllegalArgumentException with an appropriate message.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected LabelMetric.ContextcreateContext(Model<Label> model, List<Prediction<Label>> predictions) protected LabelEvaluationcreateEvaluation(LabelMetric.Context ctx, Map<MetricID<Label>, Double> results, EvaluationProvenance provenance) protected Set<LabelMetric>createMetrics(Model<Label> model) Methods inherited from class org.tribuo.evaluation.AbstractEvaluator
computeResults, evaluate, evaluate, evaluateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.tribuo.evaluation.Evaluator
createOnlineEvaluator, evaluate
-
Constructor Details
-
LabelEvaluator
public LabelEvaluator()
-
-
Method Details
-
createMetrics
- Specified by:
createMetricsin classAbstractEvaluator<Label,LabelMetric.Context, LabelEvaluation, LabelMetric>
-
createContext
protected LabelMetric.Context createContext(Model<Label> model, List<Prediction<Label>> predictions) - Specified by:
createContextin classAbstractEvaluator<Label,LabelMetric.Context, LabelEvaluation, LabelMetric>
-
createEvaluation
protected LabelEvaluation createEvaluation(LabelMetric.Context ctx, Map<MetricID<Label>, Double> results, EvaluationProvenance provenance) - Specified by:
createEvaluationin classAbstractEvaluator<Label,LabelMetric.Context, LabelEvaluation, LabelMetric>
-