Skip to content

[FAQ]Why should we use predict_proba instead of predict when computing ROC AUC? #477

Closed

Description

@Nilo0far

Course

machine-learning-zoomcamp

Question

When evaluating a Logistic Regression model with ROC AUC, why should we use the probabilities from predict_proba() instead of the class labels from predict()?

Answer

ROC AUC evaluates how well the model ranks positive examples above negative examples across different thresholds.

predict() returns only the final class labels, such as 0 or 1. This removes most of the information about how confident the model is.

For ROC AUC, we should instead use the probability of the positive class:

y_pred = model.predict_proba(X_val)[:, 1]

auc = roc_auc_score(y_val, y_pred)

These probability scores allow ROC AUC to evaluate the ranking of predictions across different thresholds.

So, for ROC AUC, predict_proba()[:, 1] is more appropriate than predict().

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

    🔄 Duplicate FAQ Entry

    Thank you for your proposal! After analyzing existing FAQs, this question appears to already be covered.

    Matching FAQ

    Question: When evaluating a Logistic Regression model with ROC AUC, why should we use the probabilities from predict_proba() instead of the class labels from predict()?
    Document ID: 139ae54c4f
    Section: module-4

    Rationale

    The existing FAQ already explains the key distinction: predict(X) returns class labels (0/1) while predict_proba(X)[:, 1] returns class probabilities, which are more appropriate for AUC.

    Where to Find This FAQ


    🤖 This issue has been automatically closed by FAQ Bot.
    If you believe this is an error, please reopen and mention a maintainer.

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