Learn R Programming

MachineShop (version 3.5.0)

LARSModel: Least Angle Regression, Lasso and Infinitesimal Forward Stagewise Models

Description

Fit variants of Lasso, and provide the entire sequence of coefficients and fits, starting from zero to the least squares fit.

Usage

LARSModel(
  type = c("lasso", "lar", "forward.stagewise", "stepwise"),
  trace = FALSE,
  normalize = TRUE,
  intercept = TRUE,
  step = numeric(),
  use.Gram = TRUE
)

Value

MLModel class object.

Arguments

type

model type.

trace

logical indicating whether status information is printed during the fitting process.

normalize

whether to standardize each variable to have unit L2 norm.

intercept

whether to include an intercept in the model.

step

algorithm step number to use for prediction. May be a decimal number indicating a fractional distance between steps. If specified, the maximum number of algorithm steps will be ceiling(step); otherwise, step will be set equal to the source package default maximum [default: max.steps].

use.Gram

whether to precompute the Gram matrix.

Details

Response types:

numeric

Automatic tuning of grid parameter:

step

Default values and further model details can be found in the source link below.

See Also

lars, fit, resample

Examples

Run this code
# \donttest{
## Requires prior installation of suggested package lars to run

fit(sale_amount ~ ., data = ICHomes, model = LARSModel)
# }

Run the code above in your browser using DataLab