Class LabelSequenceEvaluation
java.lang.Object
org.tribuo.classification.sequence.LabelSequenceEvaluation
- All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.provenance.Provenancable<EvaluationProvenance>
,SequenceEvaluation<Label>
A class that can be used to evaluate a sequence label classification model element wise on a given set of data.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
LabelSequenceEvaluation
(Map<MetricID<Label>, Double> results, LabelMetric.Context ctx, EvaluationProvenance provenance) -
Method Summary
Modifier and TypeMethodDescriptiondouble
accuracy()
double
asMap()
Get a map of all the metrics stored in this evaluation.double
double
Note: confusion is not stored in the underlying map, so it won't show up in aggregation.double
double
fn()
double
double
fp()
double
Gets the confusion matrix backing this evaluation.Gets the flattened predictions.double
double
double
double
macroFN()
double
macroFP()
double
macroTN()
double
macroTP()
double
double
double
double
double
double
tn()
double
toString()
double
tp()
double
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.tribuo.sequence.SequenceEvaluation
get
-
Constructor Details
-
LabelSequenceEvaluation
protected LabelSequenceEvaluation(Map<MetricID<Label>, Double> results, LabelMetric.Context ctx, EvaluationProvenance provenance)
-
-
Method Details
-
getPredictions
Gets the flattened predictions.- Returns:
- The flattened predictions.
-
getConfusionMatrix
Gets the confusion matrix backing this evaluation.- Returns:
- The confusion matrix.
-
asMap
Description copied from interface:SequenceEvaluation
Get a map of all the metrics stored in this evaluation. The keys are metric id's and the values are their corresponding computed results.- Specified by:
asMap
in interfaceSequenceEvaluation<Label>
- Returns:
- a map of all stored results
-
confusion
Note: confusion is not stored in the underlying map, so it won't show up in aggregation.- Parameters:
predictedLabel
- The predicted label.trueLabel
- The true label.- Returns:
- The number of times that
predictedLabel
was predicted fortrueLabel
.
-
tp
-
tp
-
macroTP
-
fp
-
fp
-
macroFP
-
tn
-
tn
-
macroTN
-
fn
-
fn
-
macroFN
-
precision
-
microAveragedPrecision
-
macroAveragedPrecision
-
recall
-
microAveragedRecall
-
macroAveragedRecall
-
f1
-
microAveragedF1
-
macroAveragedF1
-
accuracy
-
accuracy
-
balancedErrorRate
-
getProvenance
- Specified by:
getProvenance
in interfacecom.oracle.labs.mlrg.olcut.provenance.Provenancable<EvaluationProvenance>
-
toString
-