hutils (version 1.5.0)

auc: AUC

Description

Returns the area under the curve ("AUC") of a receiver-operating characteristic curve for the given predicted and actual values.

Usage

auc(actual, pred)

Arguments

actual

Logical vector: TRUE for positive class. If not a logical vector, the result is interpreted as one if safe to do so, viz. if actual contains precisely two unique values and is either a numeric vector, an ordered factor, or the unique values are FALSE and TRUE (case-insensitively). Anything else is an error.

pred

Numeric (double) vector the same length as actual giving the predicted probability of TRUE. Must be a numeric vector the same length as actual.