Learn R Programming

daltoolboxdp (version 1.2.737)

fs_lasso: LASSO Feature Selection

Description

Performs feature selection using L1-regularized regression (LASSO), implemented with glmnet.

Usage

fs_lasso(attribute)

Value

A fs_lasso object.

Arguments

attribute

Character. Name of the target variable.

References

Tibshirani, R. (1996). Regression Shrinkage and Selection via the Lasso.

Examples

Run this code
if (FALSE) {
data(iris)

# 1) LASSO requires a numeric response
fs <- daltoolbox::fit(fs_lasso("Sepal.Length"), iris)
fs$features                 # selected predictors with non-zero coefficients

# 2) Subset data to selected features + target
data_lasso <- daltoolbox::transform(fs, iris)
head(data_lasso)
}

Run the code above in your browser using DataLab