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

View source: R/S3methods_islasso.path.R

predict.islasso.pathR Documentation

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 class 'islasso.path'
predict(
  object,
  newdata,
  type = c("link", "response", "coefficients", "class"),
  lambda,
  ...
)

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.

Value

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

Author(s)

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

## Not run: 
  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)

## End(Not run)


islasso documentation built on Aug. 9, 2025, 1:06 a.m.