Computes the area under the ROC curve (AUC) for binary classification.
Arguments
- o
Numeric vector of actual binary labels (0 or 1). Must have the same length as p.
- p
Numeric vector of predicted probabilities (typically 0 to 1). Must have the same length as o.
Value
Numeric value between 0 and 1 representing the AUC. Higher values indicate better classification performance, with 0.5 indicating random performance and 1.0 indicating perfect classification.
See also
Other utilities:
.vif_to_df(),
beowulf_cluster(),
objects_size(),
optimization_function(),
prepare_importance_spatial(),
rescale_vector(),
root_mean_squared_error(),
setup_parallel_execution(),
standard_error(),
statistical_mode(),
thinning(),
thinning_til_n()
Examples
auc(
o = c(0, 0, 1, 1),
p = c(0.1, 0.6, 0.4, 0.8)
)
#> [1] 0.75