public class Specificity extends java.lang.Object implements ClassificationMeasure
SPC = TN / N = TN / (FP + TN) = 1 - FPR
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.
Modifier and Type | Field and Description |
---|---|
static Specificity |
instance |
Constructor and Description |
---|
Specificity() |
Modifier and Type | Method and Description |
---|---|
double |
measure(int[] truth,
int[] prediction)
Returns an index to measure the quality of classification.
|
static double |
of(int[] truth,
int[] prediction)
Calculates the specificity.
|
java.lang.String |
toString() |
public static final Specificity instance
public double measure(int[] truth, int[] prediction)
ClassificationMeasure
measure
in interface ClassificationMeasure
truth
- the true class labels.prediction
- the predicted class labels.public static double of(int[] truth, int[] prediction)
public java.lang.String toString()
toString
in class java.lang.Object