Makes predictions from an object of class "cv.corila".
Usage
# S3 method for class 'cv.corila'
predict(object, newx, s = "lambda.min", ...)Arguments
- object
object of class
"cv.corila"- newx
\(n_0 \times p\) predictor matrix (training data) to obtain fitted values, \(n_1 \times p\) predictor matrix (testing data) to obtain predicted values
- s
character
"lambda.min"or numeric value- ...
(for compatibility with stats::predict)
Value
Returns fitted or predicted values in an \(n_0 \times m\)-dimensional or \(n_1 \times m\)-dimensional matrix, respectively.
Details
This function calls
.expand_auxiliary() for handling auxiliary predictors,
.forescale()
for standardising the predictor matrix,
and .backscale()
for bringing predicted values back to the original scale
(if family="gaussian").
References
Armin Rauschenberger (2026). "Sparse modelling with grouped and correlated features allowing for privileged information". In preparation.
See also
Fit models with cv.corila(),
extract coefficients with coef(),
and extract fitted values with fitted().
Examples
# \donttest{
data <- simulate_data()
model <- cv.corila(x = data$x_train,
y = data$y_train,
group = data$group,
primary = data$primary)
beta_hat <- coef(object = model)
y_hat <- predict(object = model, newx = data$x_test)
# }
# example for automatic mutation testing (with the R package autotest)
data <- simulate_data()
model <- cv.corila(x = data$x_train,
y = data$y_train,
group = as.double(data$group),
primary = data$primary,
alpha_init = 0.0,
foldid = rep(1:10, length.out = nrow(data$x_train)))