
Use a cross validated penalized maximum likelihood generalized linear model to perform feature selection
Source:R/shrink.R
shrink.Rd
Use a cross validated penalized maximum likelihood generalized linear model to perform feature selection
Usage
shrink(data, threshold = c("one", "all"), plot = FALSE, ...)
Arguments
- data
feature_calculations
object containing the raw feature matrix produced bytheft::calculate_features
- threshold
character
denoting whether to retain features that have at least one non-zero coefficient"one"
across all group levels or features that have non-zero coefficients across all group levels"all"
. Applicable to multinomial case only. Defaults to"one"
for less aggressive filtering- plot
Boolean
whether to draw the misclassification error lambda plot for acv.glmnet
object. Defaults toFALSE
- ...
arguments to be passed to
glmnet::cv.glmnet
Examples
library(theft)
features <- theft::calculate_features(theft::simData,
feature_set = "catch22")
#> Running computations for catch22...
best_features <- shrink(features)