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.
glmnet
lambda.min
if (requireNamespace("glmnet", quietly = TRUE)) { data(iris) fs <- feature_selection_lasso("Sepal.Length") fs <- fit(fs, iris) fs$selected iris_fs <- transform(fs, iris) names(iris_fs) }
Run the code above in your browser using DataLab