assess: Assess predictive performance

View source: R/assess.xplus.R

assessR Documentation

Assess predictive performance

Description

Assess predictive performance

Usage

assess(object, newx = NULL, newy, weights = NULL, ...)

## S3 method for class 'xplus'
assess(object, newx = NULL, newy, weights = NULL, ...)

Arguments

object

A model object.

newx

Optional feature matrix.

newy

Binary 0/1 labels or a two-column finite nonnegative matrix of negative and positive class masses; soft vectors are not accepted.

weights

Optional finite nonnegative numeric row weights without recycling; NULL means unit weights.

...

Additional arguments passed to predict().

Value

A named list with deviance, class, auc, mse, and mae. For class metric, the threshold used is the model's cutoff (from object$cutoff), consistent with predict(type = "class"); MSE and MAE sum both class-column losses (twice the scalar loss). Undefined metrics return NA with a warning.

References

Zhou et al. (2022). doi:10.1371/journal.pcbi.1009956

See Also

xplus(), get_auc()

Examples

set.seed(1)
x <- matrix(rnorm(100 * 5), ncol = 5)
y <- c(rep(1, 20), rep(0, 80))
fit <- xplus(x, y, max_iter = 5)
assess(fit, newx = x, newy = y)

xplus documentation built on Sept. 26, 2026, 5:07 p.m.