Loads all PI model RDS files from a directory into a list. Automatically detects whether models are LASSO (glmnet) or GLM type.
load_PI_models(model_dir, pattern = "^model_.*\\.rds$")List with components:
List of fitted model objects
"LASSO" or "GLM" (auto-detected from first model)
Number of models loaded
Source directory path
if (FALSE) { # \dontrun{
# Load models from directory
result <- load_PI_models("path/to/piModels/")
cat("Loaded", result$n_models, result$model_type, "models\n")
} # }