Class LabelSequenceEvaluator
java.lang.Object
org.tribuo.sequence.AbstractSequenceEvaluator<Label,LabelMetric.Context,LabelSequenceEvaluation,LabelMetric>
org.tribuo.classification.sequence.LabelSequenceEvaluator
- All Implemented Interfaces:
SequenceEvaluator<Label,
LabelSequenceEvaluation>
public class LabelSequenceEvaluator
extends AbstractSequenceEvaluator<Label,LabelMetric.Context,LabelSequenceEvaluation,LabelMetric>
A sequence evaluator for labels.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected LabelMetric.Context
createContext
(SequenceModel<Label> model, List<List<Prediction<Label>>> predictions) Create the context needed for evaluation.protected LabelSequenceEvaluation
createEvaluation
(LabelMetric.Context ctx, Map<MetricID<Label>, Double> results, EvaluationProvenance provenance) Create an evaluation for the given resultsprotected Set<LabelMetric>
createMetrics
(SequenceModel<Label> model) Creates the appropriate set of metrics for this model, by querying for it'sOutputInfo
.Methods inherited from class org.tribuo.sequence.AbstractSequenceEvaluator
computeResults, evaluate, evaluate, evaluate
-
Constructor Details
-
LabelSequenceEvaluator
public LabelSequenceEvaluator()
-
-
Method Details
-
createMetrics
Description copied from class:AbstractSequenceEvaluator
Creates the appropriate set of metrics for this model, by querying for it'sOutputInfo
.- Specified by:
createMetrics
in classAbstractSequenceEvaluator<Label,
LabelMetric.Context, LabelSequenceEvaluation, LabelMetric> - Parameters:
model
- The model to inspect.- Returns:
- The set of metrics.
-
createContext
protected LabelMetric.Context createContext(SequenceModel<Label> model, List<List<Prediction<Label>>> predictions) Description copied from class:AbstractSequenceEvaluator
Create the context needed for evaluation. The context might store global properties or cache computation.- Specified by:
createContext
in classAbstractSequenceEvaluator<Label,
LabelMetric.Context, LabelSequenceEvaluation, LabelMetric> - Parameters:
model
- the model that will be evaluatedpredictions
- the predictions that will be evaluated- Returns:
- the context for this model and its predictions
-
createEvaluation
protected LabelSequenceEvaluation createEvaluation(LabelMetric.Context ctx, Map<MetricID<Label>, Double> results, EvaluationProvenance provenance) Description copied from class:AbstractSequenceEvaluator
Create an evaluation for the given results- Specified by:
createEvaluation
in classAbstractSequenceEvaluator<Label,
LabelMetric.Context, LabelSequenceEvaluation, LabelMetric> - Parameters:
ctx
- the context that was used to compute these resultsresults
- the resultsprovenance
- the provenance of the results (including information about the model and dataset)- Returns:
- the evaluation
-