get_predictions: Build a tidy prediction table

View source: R/get_predictions.R

get_predictionsR Documentation

Build a tidy prediction table

Description

Build a tidy prediction table

Usage

get_predictions(object, newx, newy, use_cutoff = TRUE)

Arguments

object

An xplus model object.

newx

Feature matrix.

newy

True labels.

use_cutoff

Logical; if TRUE, classify with the model's cutoff. If FALSE, classify probabilities strictly greater than 0.5 as positive.

Value

A tibble with truth labels, probabilities and predicted classes; Class1 is the positive label 1, classified by probability strictly greater than the cutoff.

References

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

See Also

predict.xplus(), assess()

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)
get_predictions(fit, x, y)

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