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
public double tp() -
macroTP
public double macroTP() -
fp
-
fp
public double fp() -
macroFP
public double macroFP() -
tn
-
tn
public double tn() -
macroTN
public double macroTN() -
fn
-
fn
public double fn() -
macroFN
public double macroFN() -
precision
-
microAveragedPrecision
public double microAveragedPrecision() -
macroAveragedPrecision
public double macroAveragedPrecision() -
recall
-
microAveragedRecall
public double microAveragedRecall() -
macroAveragedRecall
public double macroAveragedRecall() -
f1
-
microAveragedF1
public double microAveragedF1() -
macroAveragedF1
public double macroAveragedF1() -
accuracy
public double accuracy() -
accuracy
-
balancedErrorRate
public double balancedErrorRate() -
getProvenance
- Specified by:
getProvenancein interfacecom.oracle.labs.mlrg.olcut.provenance.Provenancable<EvaluationProvenance>
-
toString
-