Skip to main content
🔒 Preview mode. The first 15 Foundations lessons are free; this one is Pro. Start a 7-day trial to unlock the editor, AI hints and the rest of the curriculum. Card required, cancel any time in Dashboard.Start 7-day trial →
← CoursesData Science AppliedModule 4 · Causal Inference & A/B TestingPredict: ROC AUC for perfect rankingpredict57 / 104
+75 XP
Task
📝 **Question:** What ROC AUC does `roc_auc_score([0, 0, 1, 1], [0.1, 0.2, 0.7, 0.9])` return? 📋 Pick the right answer. 💡 **Hint:** Re-read the theory above if unsure.
Predict the output

Read the code carefully

from sklearn.metrics import roc_auc_score

# labels:  [0,   0,   1,   1  ]   (two negatives, two positives)
# scores:  [0.1, 0.2, 0.7, 0.9]
#
# AUC = P(score of random positive > score of random negative)
#
# Count the positive-negative score pairs and how many are correctly
# ordered. Divide.

print(roc_auc_score([0, 0, 1, 1], [0.1, 0.2, 0.7, 0.9]))

# What does this print? Type your prediction.

What will the program print? Write here:

💬 Discussion

Be the first to ask a question or share a tip.
Sign in to join the discussion. Reading is free.
Loading discussion…