View source: R/S3methods_islasso.path.R
predict.islasso.path | R Documentation |
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.
## S3 method for class 'islasso.path'
predict(
object,
newdata,
type = c("link", "response", "coefficients", "class"),
lambda,
...
)
object |
A fitted model object of class |
newdata |
Optional data frame containing covariates for prediction. If omitted, returns fitted values from the original model. |
type |
Character. Type of prediction:
|
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. |
A vector, matrix, or list depending on the type
requested.
Gianluca Sottile gianluca.sottile@unipa.it
islasso.path
, summary.islasso.path
, coef.islasso.path
,
GoF.islasso.path
, fitted.islasso.path
, logLik.islasso.path
,
residuals.islasso.path
, deviance.islasso.path
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.