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) Constructs a LabelSequenceEvaluation using the supplied parameters. -
Method Summary
Modifier and TypeMethodDescriptiondoubleaccuracy()The accuracy.doubleGets the accuracy for this label.asMap()Get a map of all the metrics stored in this evaluation.doubleGets the balanced error rate.doubleNote: confusion is not stored in the underlying map, so it won't show up in aggregation.doubleThe F1 for this label.doublefn()Gets the micro averaged false negative count.doubleThe false negative count for this label.doublefp()Gets the micro averaged false positive count.doubleThe false positive count for this label.Gets the confusion matrix backing this evaluation.Gets the flattened predictions.doubleThe macro averaged F1.doubleThe macro averaged precision.doubleThe macro averaged recall.doublemacroFN()Gets the macro averaged false negative count.doublemacroFP()Gets the macro averaged false positive count.doublemacroTN()Gets the macro averaged true negative count.doublemacroTP()Gets the macro averaged true positive count.doubleThe micro averaged F1.doubleThe micro averaged precision.doubleThe micro averaged recall.doubleThe precision for this label.doubleThe recall for this label.doubletn()Gets the micro averaged true negative count.doubleThe true negative count for this label.toString()doubletp()Gets the micro averaged true positive count.doubleGets the true positive count for that label.Methods 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) Constructs a LabelSequenceEvaluation using the supplied parameters.- Parameters:
results- The metric values.ctx- The context.provenance- The evaluation 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
Gets the true positive count for that label.- Parameters:
label- The label.- Returns:
- The true positive count.
-
tp
public double tp()Gets the micro averaged true positive count.- Returns:
- The micro averaged true positive count.
-
macroTP
public double macroTP()Gets the macro averaged true positive count.- Returns:
- The macro averaged true positive count.
-
fp
The false positive count for this label.- Parameters:
label- The label.- Returns:
- The false positive count.
-
fp
public double fp()Gets the micro averaged false positive count.- Returns:
- The micro averaged false positive count.
-
macroFP
public double macroFP()Gets the macro averaged false positive count.- Returns:
- The macro averaged false positive count.
-
tn
The true negative count for this label.- Parameters:
label- The label.- Returns:
- The true negative count.
-
tn
public double tn()Gets the micro averaged true negative count.- Returns:
- The micro averaged true negative count.
-
macroTN
public double macroTN()Gets the macro averaged true negative count.- Returns:
- The macro averaged true negative count.
-
fn
The false negative count for this label.- Parameters:
label- The label.- Returns:
- The false negative count.
-
fn
public double fn()Gets the micro averaged false negative count.- Returns:
- The micro averaged false negative count.
-
macroFN
public double macroFN()Gets the macro averaged false negative count.- Returns:
- The macro averaged false negative count.
-
precision
The precision for this label.- Parameters:
label- The label.- Returns:
- The precision.
-
microAveragedPrecision
public double microAveragedPrecision()The micro averaged precision.- Returns:
- The micro averaged precision.
-
macroAveragedPrecision
public double macroAveragedPrecision()The macro averaged precision.- Returns:
- The macro averaged precision.
-
recall
The recall for this label.- Parameters:
label- The label.- Returns:
- The recall.
-
microAveragedRecall
public double microAveragedRecall()The micro averaged recall.- Returns:
- The micro averaged recall.
-
macroAveragedRecall
public double macroAveragedRecall()The macro averaged recall.- Returns:
- The macro averaged recall.
-
f1
The F1 for this label.- Parameters:
label- The label.- Returns:
- The F1.
-
microAveragedF1
public double microAveragedF1()The micro averaged F1.- Returns:
- The micro averaged F1.
-
macroAveragedF1
public double macroAveragedF1()The macro averaged F1.- Returns:
- The macro averaged F1.
-
accuracy
public double accuracy()The accuracy.- Returns:
- The accuracy.
-
accuracy
Gets the accuracy for this label.- Parameters:
label- The label.- Returns:
- The accuracy.
-
balancedErrorRate
public double balancedErrorRate()Gets the balanced error rate.Also known as 1 - the macro averaged recall.
- Returns:
- The balanced error rate.
-
getProvenance
- Specified by:
getProvenancein interfacecom.oracle.labs.mlrg.olcut.provenance.Provenancable<EvaluationProvenance>
-
toString
-