feature_selection_lasso: Feature selection by lasso

View source: R/trans_feature_selection_lasso.R

feature_selection_lassoR Documentation

Feature selection by lasso

Description

Selects predictors using L1-regularized regression.

Usage

feature_selection_lasso(attribute, features = NULL)

Arguments

attribute

target attribute name

features

optional vector of feature names (default: all numeric columns except attribute)

Details

Fits a lasso path with glmnet and keeps predictors with non-zero coefficients at lambda.min. The target attribute must be numeric.

Value

returns an object of class feature_selection_lasso

Examples

if (requireNamespace("glmnet", quietly = TRUE)) {
 data(Boston)
 fs <- feature_selection_lasso("medv")
 fs <- fit(fs, Boston)
 fs$selected
 boston_fs <- transform(fs, Boston)
 names(boston_fs)
}

daltoolbox documentation built on May 14, 2026, 9:06 a.m.