Skip to contents

Computes the AUC score of binary model predictions.

Usage

auc_score(observed = NULL, predicted = NULL)

Arguments

observed

(required, integer) Numeric vector with observations. Valid values are 1 and 0. Must have the same length as predicted. Default: NULL

predicted

(required, numeric) Numeric vector in the range 0-1 with binary model predictions. Must have the same length as observed.

Value

AUC value.

Examples


 out <- auc_score(
   observed = c(0, 0, 1, 1),
   predicted = c(0.1, 0.6, 0.4, 0.8)
   )