
Use a cross validated penalized maximum likelihood generalized linear model to perform feature selection
Source:R/shrink.R
      shrink.RdUse 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_calculationsobject containing the raw feature matrix produced bytheft::calculate_features- threshold
 characterdenoting 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
 Booleanwhether to draw the misclassification error lambda plot for acv.glmnetobject. 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)