Package smile.validation.metric
Class Sensitivity
java.lang.Object
smile.validation.metric.Sensitivity
- All Implemented Interfaces:
Serializable
,ToDoubleBiFunction<int[],
,int[]> ClassificationMetric
Sensitivity or true positive rate (TPR) (also called hit rate, recall) is a
statistical measures of the performance of a binary classification test.
Sensitivity is the proportion of actual positives which are correctly
identified as such.
TPR = TP / P = TP / (TP + FN)Sensitivity and specificity are closely related to the concepts of type I and type II errors. For any test, there is usually a trade-off between the measures. This trade-off can be represented graphically using an ROC curve.
In this implementation, the class label 1 is regarded as positive and 0 is regarded as negative.
- See Also:
-
Field Details
-
instance
Default instance.
-
-
Constructor Details
-
Sensitivity
public Sensitivity()
-
-
Method Details
-
score
public double score(int[] truth, int[] prediction) Description copied from interface:ClassificationMetric
Returns a score to measure the quality of classification.- Specified by:
score
in interfaceClassificationMetric
- Parameters:
truth
- the true class labels.prediction
- the predicted class labels.- Returns:
- the metric.
-
of
public static double of(int[] truth, int[] prediction) Calculates the sensitivity.- Parameters:
truth
- the ground truth.prediction
- the prediction.- Returns:
- the metric.
-
toString
-