powered by
Selects predictors using L1-regularized regression.
feature_selection_lasso(attribute, features = NULL)
returns an object of class feature_selection_lasso
feature_selection_lasso
target attribute name
optional vector of feature names (default: all numeric columns except attribute)
attribute
Fits a lasso path with glmnet and keeps predictors with non-zero coefficients at lambda.min. The target attribute must be numeric.
glmnet
lambda.min
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) }
Run the code above in your browser using DataLab