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
ConstructorsModifierConstructorDescriptionprotectedLabelSequenceEvaluation(Map<MetricID<Label>, Double> results, LabelMetric.Context ctx, EvaluationProvenance provenance) -
Method Summary
Modifier and TypeMethodDescriptiondoubleaccuracy()doubleasMap()Get a map of all the metrics stored in this evaluation.doubledoubleNote: confusion is not stored in the underlying map, so it won't show up in aggregation.doubledoublefn()doubledoublefp()doubleGets the confusion matrix backing this evaluation.Gets the flattened predictions.doubledoubledoubledoublemacroFN()doublemacroFP()doublemacroTN()doublemacroTP()doubledoubledoubledoubledoubledoubletn()doubletoString()doubletp()doubleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:SequenceEvaluationGet 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:
asMapin 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
predictedLabelwas 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:
getProvenancein interfacecom.oracle.labs.mlrg.olcut.provenance.Provenancable<EvaluationProvenance>
-
toString
-