# Can AUC-ROC be between 0-0.5?

Can AUC-ROC values be between 0-0.5? Does the model ever output values between 0 and 0.5?

A perfect predictor gives an AUC-ROC score of 1, a predictor which makes random guesses has an AUC-ROC score of 0.5.

If you get a score of 0 that means the classifier is perfectly incorrect, it is predicting the incorrect choice 100% of the time. If you just changed the prediction of this classifier to the opposite choice then it could predict perfectly and have an AUC-ROC score of 1.

So in practice if you get an AUC-ROC score between 0 and 0.5 you might have a mistake in the way you labeled your classifier targets or you might have a bad training algorithm. If you get a score of 0.2 this shows that the data contains enough information to get a score of 0.8 but something went wrong.

• I think this answer skips over the possibility that the model has overfit, for example obtaining AUC of 0.8 on training data but AUC of 0.35 on holdout data.
– Sycorax
Oct 4, 2018 at 15:19
• @Sycorax: Hmm, I can see how overfitting could obviously drive the AUC to where it's at chance level (if you're so far from the true model that your predictions are just garbage), but how would it go (significantly) below chance? Feb 4, 2019 at 16:20
• You'll have an AUC below 0.5 whenever the ranking on some set is closer to being backward than correct. It's not any different from overfitting in any other context.
– Sycorax
Feb 4, 2019 at 16:30
• @Sycorax, it is very different from overfitting, I wonder if anyone can bring an example of an AUC actually being significantly lower than 0.5. Overfitting can only lead to the AUC on the validation data being closer to the random model, but not going under. I'm sure it can be statistically proven that if test and validation sets are truly random and have the same distribution, it wouldn't be possible for the validation AUC to be lower than 0.5 other than by chance. May 8 at 2:04
• @IonLesan Even if you can prove that, and then you observe this backward behavior in your data, then that would provide some evidence that the independence and distribution assumptions of that theorem you outline are not satisfied in the specific problem you’re working on. In other words, you’ve arrived at an overfitting scenario because real world data sets sometimes don’t exhibit idealized assumptions.
– Sycorax
May 8 at 2:33

I am sorry, but these answers are dangerously wrong. No, you cannot just flip AUC after you see the data. Imagine you are buying stocks, and you always bought the wrong one, but you said to yourself, then it's ok, because if you were purchasing the opposite of what your model was predicting, then you would make money.

The thing is that there are many, often non-obvious reasons how you can bias your results and get consistently below-average performance. If you now flip your AUC, you might think you are the best modeler in the world, although there was never any signal in the data.

Here is a simulation example. Notice that the predictor is just a random variable with no relationship to the target. Also, notice that the average AUC is around 0.3.

library(MLmetrics)
aucs <- list()
for (sim in seq_len(100)){
n <- 100
df <- data.frame(x=rnorm(n),
y=c(rep(0, n/2), rep(1, n/2)))

predictions <- list()
for(i in seq_len(n)){
train <- df[-i,]
test <- df[i,]

glm_fit <- glm(y ~ x, family = 'binomial', data = train)
predictions[[i]] <- predict(glm_fit, newdata = test, type = 'response')
}
predictions <- unlist(predictions)
aucs[[sim]] <- MLmetrics::AUC(predictions, df\$y)
}
aucs <- unlist(aucs)
plot(aucs); abline(h=mean(aucs), col='red')


Results Of course, there is no way a classifier could learn anything from the data since the data are random. The bellow chance AUC is there because LOOCV creates a biased, unbalanced training set. However, that doesn't mean that if you don't use LOOCV, you are safe. The point of this story is that there are ways, many ways how the results can have bellow average performance even if there is nothing in the data, and therefore you should not flip the predictions unless you know what you are doing. And since you've got bellow average performance, you don't see what you are doing :)

Here is a couple of papers that touched this problem, but I am sure others did as well

How to control for confounds in decoding analyses of neuroimaging data by Snoek et al (2019).

• This should be the accepted answer!
– tdc
Feb 13, 2020 at 22:30
• It would be helpful if someone could explain in plain English what is being simulated by the code and what the results are. At present, these are left to the reader to figure out which reduces the accessibility of the answer.
– Sia
Dec 11, 2021 at 20:37
• You are dealing here with situations occurring by chance, which are also very likely when you only have training sets of 100 samples. May 8 at 1:47

They can, if the system you're analyzing performs below chance level. Trivially, you could easily construct a classifier with 0 AUC by having it always answer opposite to the truth.

In practice of course you train your classifier on some data so values very much smaller than 0.5 would typically indicate an error in your algorithm, data labels, or choice of train/test data. E.g. if you mistakenly switched the class labels in your train data your expected AUC would be 1 minus the "true" AUC (given correct labels). The AUC could also be < 0.5 if you split your data into train & test partitions in such a way that the patterns to be classified were systematically different. This might happen (for example) if one class was more common in the train vs. the test set, or if the patterns in each set had systematically different intercepts that you didn't correct for.

Lastly, it could also happen randomly because your classifier is at chance level in the long run but happened to get "unlucky" in your test sample (i.e. get a few more errors than successes). But in that case the values should still be relatively close to 0.5 (how close depends on the number of data points).

• I found AUC fluctuate a lot between 0.5 for some time because of the regularization or we intentionally do some smooth labelling as well. But the validation should be above it 0.5 by all means otherwise something is wrong! Aug 12, 2021 at 0:01