Learn R Programming

islasso (version 1.6.0)

predict.islasso.path: Prediction Method for islasso.path Objects

Description

Generates predictions from a fitted islasso.path model at one or more lambda values. Supports various output types including linear predictors, response scale, class labels, and coefficients.

Usage

# S3 method for islasso.path
predict(
  object,
  newdata,
  type = c("link", "response", "coefficients", "class"),
  lambda,
  ...
)

Value

A vector, matrix, or list depending on the type requested.

Arguments

object

A fitted model object of class "islasso.path".

newdata

Optional data frame containing covariates for prediction. If omitted, returns fitted values from the original model.

type

Character. Type of prediction:

  • "link" (default) - linear predictor scale,

  • "response" - original response scale,

  • "coefficients" - estimated coefficients,

  • "class" - predicted class labels (only for binomial models).

lambda

Numeric value(s). Specific lambda value(s) at which predictions are required. If missing, predictions are computed for the full lambda sequence.

...

Additional arguments passed to lower-level methods.

Author

Gianluca Sottile gianluca.sottile@unipa.it

See Also

islasso.path, summary.islasso.path, coef.islasso.path, GoF.islasso.path, fitted.islasso.path, logLik.islasso.path, residuals.islasso.path, deviance.islasso.path

Examples

Run this code
if (FALSE) {
  set.seed(1)
  n <- 100; p <- 30
  beta <- c(runif(10, -3, 3), rep(0, p - 10))
  sim <- simulXy(n = n, p = p, beta = beta, seed = 1, family = gaussian())
  fit <- islasso.path(y ~ ., data = sim$data, family = gaussian())
  optimal <- GoF.islasso.path(fit)
  pred <- predict(fit, type = "response", lambda = optimal$lambda.min)
}

Run the code above in your browser using DataLab