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
ModifierConstructorDescriptionprotected
LabelSequenceEvaluation
(Map<MetricID<Label>, Double> results, LabelMetric.Context ctx, EvaluationProvenance provenance) Constructs a LabelSequenceEvaluation using the supplied parameters. -
Method Summary
Modifier and TypeMethodDescriptiondouble
accuracy()
The accuracy.double
Gets the accuracy for this label.asMap()
Get a map of all the metrics stored in this evaluation.double
Gets the balanced error rate.double
Note: confusion is not stored in the underlying map, so it won't show up in aggregation.double
The F1 for this label.double
fn()
Gets the micro averaged false negative count.double
The false negative count for this label.double
fp()
Gets the micro averaged false positive count.double
The false positive count for this label.Gets the confusion matrix backing this evaluation.Gets the flattened predictions.double
The macro averaged F1.double
The macro averaged precision.double
The macro averaged recall.double
macroFN()
Gets the macro averaged false negative count.double
macroFP()
Gets the macro averaged false positive count.double
macroTN()
Gets the macro averaged true negative count.double
macroTP()
Gets the macro averaged true positive count.double
The micro averaged F1.double
The micro averaged precision.double
The micro averaged recall.double
The precision for this label.double
The recall for this label.double
tn()
Gets the micro averaged true negative count.double
The true negative count for this label.toString()
double
tp()
Gets the micro averaged true positive count.double
Gets the true positive count for that label.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) 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: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
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:
getProvenance
in interfacecom.oracle.labs.mlrg.olcut.provenance.Provenancable<EvaluationProvenance>
-
toString
-