ROC#
- class scio.eval.ROC(labels, scores)[source]#
Bases:
objectROC utility for Discriminative Power and visualization.
We recall that a Discriminative Power only depends on the Pareto front of all the \((FP, TP)\) tuples when thresholding with every possible threshold. Per convention:
The thresholding test is
score <= threshold.Positive (i.e. OoD) samples should verify this and thus have a low score.
Scores must not be
nan.
- Parameters:
labels (
ArrayLike) – The label of samples, interpreted asbool. Shape(n_samples,).scores (
ArrayLike) – The score of samples. Shape(n_samples,).
- Raises:
AssertionError – If there is no positive (resp. negative) labels.
AssertionError – If there is at least one
nanscore.
Note
In cases where the ROC curve would theoretically begin with a nonzero
FPR, we artificially add the point \((0, 0)\) — corresponding to the trivial False classifier —, for consistency in Discriminative Power definitions. This situation arises when a negative (i.e. InD) sample is assigned a score of \(-\infty\).Useful methods defined here
plot(*[, legend, ax])Plot the ROC curve.
Useful attributes defined here
False Negative points.
False Negative Rate points.
Same as
FNR, reduced to convex hull front.Same as
FN, reduced to convex hull front.False Positive points.
False Positive Rate points.
Same as
FPR, reduced to convex hull front.Same as
FP, reduced to convex hull front.Total number of negative samples.
Total number of positive samples.
True Negative points.
True Negative Rate points.
Same as
TNR, reduced to convex hull front.Same as
TN, reduced to convex hull front.True Positive points.
True Positive Rate points.
Same as
TPR, reduced to convex hull front.Same as
TP, reduced to convex hull front.Ordered \((FP, TP)\) tuples defining the Pareto front.
Same as
pareto, reduced to convex hull front.The threshold intervals associated with Pareto points.
Same as
thresholds, reduced to convex hull front.Total population size.