Examples: LASSOLKT Preset

source("lkt-vignette-setup.R")
## Executable examples are disabled for routine package builds. Set LKT_RUN_EXPENSIVE_VIGNETTES=true to run this vignette.
knitr::opts_chunk$set(eval = run_expensive_vignette)

The full LASSO path is intentionally not evaluated during routine CRAN checks. Set LKT_RUN_EXPENSIVE_VIGNETTES=true to execute it when rendering.

Load data

val <- prepare_largeraw_sample()

LASSOLKT with preset

modelob <- LASSOLKTModel(
  data = val,
  gridpars = (1:9) / 10,
  allcomponents = c("Anon.Student.Id", "KC..Default."),
  preset = "PFA",
  target_n = 5
)

check_true("LASSOLKT preset returned a list", is.list(modelob))
check_true("LASSOLKT preset has glmnet fit", inherits(modelob$fit, "glmnet"))
check_true("LASSOLKT preset target AUC finite", is.finite(as.numeric(modelob$target_auc)))
check_true("LASSOLKT preset target coefficients present", nrow(modelob$target_coefs) > 0)