inst/doc/introduction.R

## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(collapse = TRUE, comment = "#>")

## ----basic-workflow-----------------------------------------------------------
library(xplus)
set.seed(1)
x <- matrix(rnorm(200 * 10), ncol = 10)
y <- c(rep(1, 40), rep(0, 160))

fit <- xplus(x, y, max_iter = 20, seed = 42)
summary(fit)
fit$stop_reason
fit$fallback_used
head(predict(fit, x, type = "response"))
levels(predict(fit, x, type = "class"))

## ----assessment---------------------------------------------------------------
metrics <- assess(fit, newx = x, newy = y, s = "lambda.1se")
metrics$auc
get_auc(fit, newx = x, newy = y, s = "lambda.1se")

Try the xplus package in your browser

Any scripts or data that you put into this service are public.

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