A ROC curve has particular meaning about how the sensitivity and specificity change as the classification threshold changes for two groups of data. The x- and y-axes both range from zero to one, and the curve is weakly increasing.
We want our ROC curves to be above the $45$-degree line, but terrible performance can result in a curve below this diagonal (though some calibration might fix such an issue).
However, can a ROC curve exist that is partially above the diagonal and partly below? What conditions would the data have to satisfy for this to happen? I imagine something like the shape below.
library(ggplot2)
x <- seq(0, 1, 0.01)
y <- pbeta(x, 9, 9)
d <- data.frame(
FPR = x,
TPR = y,
Curve = "ROC"
)
ggplot(d, aes(x = FPR, y = TPR, col = Curve)) +
geom_line(linewidth = 2) +
geom_abline(slope = 1, intercept = 0) +
theme(legend.position = "none")


