Enum LabelMetrics
- All Implemented Interfaces:
- Serializable,- Comparable<LabelMetrics>,- java.lang.constant.Constable
An enum of the default 
LabelMetrics supported by the multi-class classification
 evaluation package.- 
Nested Class SummaryNested classes/interfaces inherited from class java.lang.EnumEnum.EnumDesc<E extends Enum<E>>
- 
Enum Constant SummaryEnum ConstantsEnum ConstantDescriptionThe accuracy.The area under the receiver-operator curve (ROC).The averaged precision.The balanced error rate, i.e., the mean of the per class recalls.The F_1 score, i.e., the harmonic mean of the precision and the recall.The number of false negatives.The number of false positives.The precision, i.e., the number of true positives divided by the number of predicted positives.The recall, i.e., the number of true positives divided by the number of ground truth positives.The number of true negatives.The number of true positives.
- 
Method SummaryModifier and TypeMethodDescriptionstatic doubleAUCROC(Label label, List<Prediction<Label>> predictions) Area under the ROC curve.static doubleAUCROC(MetricTarget<Label> tgt, List<Prediction<Label>> predictions) Area under the ROC curve.static doubleaveragedPrecision(Label label, List<Prediction<Label>> predictions) static doubleaveragedPrecision(MetricTarget<Label> tgt, List<Prediction<Label>> predictions) forTarget(MetricTarget<Label> tgt) Gets the LabelMetric wrapped around the supplied MetricTarget.getImpl()Returns the implementing function for this metric.static LabelEvaluationUtil.PRCurveprecisionRecallCurve(Label label, List<Prediction<Label>> predictions) static LabelMetricsReturns the enum constant of this type with the specified name.static LabelMetrics[]values()Returns an array containing the constants of this enum type, in the order they are declared.
- 
Enum Constant Details- 
TPThe number of true positives.
- 
FPThe number of false positives.
- 
TNThe number of true negatives.
- 
FNThe number of false negatives.
- 
PRECISIONThe precision, i.e., the number of true positives divided by the number of predicted positives.
- 
RECALLThe recall, i.e., the number of true positives divided by the number of ground truth positives.
- 
F1The F_1 score, i.e., the harmonic mean of the precision and the recall.
- 
ACCURACYThe accuracy.
- 
BALANCED_ERROR_RATEThe balanced error rate, i.e., the mean of the per class recalls.
- 
AUCROCThe area under the receiver-operator curve (ROC).
- 
AVERAGED_PRECISIONThe averaged precision.
 
- 
- 
Method Details- 
valuesReturns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
 
- 
valueOfReturns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
- name- the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
- IllegalArgumentException- if this enum type has no constant with the specified name
- NullPointerException- if the argument is null
 
- 
getImplReturns the implementing function for this metric.- Returns:
- The implementing function.
 
- 
forTargetGets the LabelMetric wrapped around the supplied MetricTarget.- Parameters:
- tgt- The metric target.
- Returns:
- The label metric combining the implementation function with the supplied metric target.
 
- 
averagedPrecisionpublic static double averagedPrecision(MetricTarget<Label> tgt, List<Prediction<Label>> predictions) - Parameters:
- tgt- The metric target to use.
- predictions- The predictions to use.
- Returns:
- The averaged precision for the supplied target with the supplied predictions.
- See Also:
 
- 
averagedPrecision- Parameters:
- label- The Label to average across.
- predictions- The predictions to use.
- Returns:
- The averaged precision for the supplied label with the supplied predictions.
- See Also:
 
- 
precisionRecallCurvepublic static LabelEvaluationUtil.PRCurve precisionRecallCurve(Label label, List<Prediction<Label>> predictions) - Parameters:
- label- The Label to calculate precision and recall for.
- predictions- The predictions to use.
- Returns:
- The Precision Recall Curve for the supplied label with the supplied predictions.
- See Also:
 
- 
AUCROCArea under the ROC curve.- Parameters:
- label- the label corresponding to the "positive" class
- predictions- the predictions for which we'll compute the score
- Returns:
- AUC ROC score
- Throws:
- UnsupportedOperationException- if a prediction with no probability score, which are required to compute the ROC curve. (See also:- Model.generatesProbabilities())
 
- 
AUCROCArea under the ROC curve.- Parameters:
- tgt- The metric target for the positive class.
- predictions- the predictions for which we'll compute the score
- Returns:
- AUC ROC score
- Throws:
- UnsupportedOperationException- if a prediction with no probability score, which are required to compute the ROC curve. (See also:- Model.generatesProbabilities())
 
 
-