Skip to content

[FAQ]Why can a numerical feature have ROC AUC below 0.5, and why can we invert it? #478

Closed as not planned

Description

@Nilo0far

Course

machine-learning-zoomcamp

Question

Why can a numerical feature have a ROC AUC below 0.5, and why can we invert the feature when using AUC for feature importance?

Answer

An AUC below 0.5 does not necessarily mean that the feature contains no useful information.

It can mean that the feature is related to the target in the opposite direction. For example, higher values of the feature may be associated with the negative class instead of the positive class.

When we use a single numerical feature as a prediction score, we can reverse its direction:

if auc < 0.5:
auc = roc_auc_score(y_train, -df_train[feature])

Negating the feature reverses its ranking. This allows us to measure how strongly the feature separates the two classes regardless of whether the relationship is positive or negative.

So, in this context, an AUC below 0.5 may indicate useful predictive information with an inverse relationship to the target.

Checklist

  • I have searched existing FAQs and this question is not already answered
  • The answer provides accurate, helpful information
  • I have included any relevant code examples or links

Activity

  1. github-actions commented on Oct 19, 2026

    @github-actions
    Contributor

    ✅ FAQ UPDATE proposal created in PR #479

    Please review and approve the changes.

  2. alexeygrigorev commented on Oct 26, 2026

    @alexeygrigorev
    Member

    Covered by existing FAQ entries 866f5d58d2 and 6a8dccc107, see #479.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions