Select the variables from dataframe by removing the rare variables and apply 'SAFE' on it.
safe_selection(
df,
var_surrogate,
surrogate_quali,
threshold = 0.05,
alpha = 0.5,
remove_var_surrogate = TRUE,
bool_weight = FALSE,
...
)A list
glmnet_model - A list of three elements: the cv.glmnet fitted model, the coefficients of non zero variables and the vector of non zero coefficient variables.
important_var - A vector with the variables used for the surrogate and the non zero variables.
surrogate_quali - The surrogate_quali argument.
dataframe
variables used for building the surrogates
surrogate with 3 values (0 and 1 the extremes and 3 middle patients)
rareness threshold (default = 0.05).
glmnet parameter (default is 0.5 elastic net)
does the glmnet algorithm should learn on features in var_surrogate (default is TRUE).
Should the glmnet function be weighted to balance the extrema populations (default is FALSE).
arguments to pass to pretty_cv.glmnet