I believe the below lines can be removed from run_lasso.R since it is now done in file auto_mrp.R.
# covariates to factor variables in training and validation sets
data_train <- data_train %>%
dplyr::mutate_at(.vars = c(L1.x, L2.unit, L2.reg), as.factor) %>%
dplyr::select(dplyr::all_of(c(y, L1.x, L2.x, L2.unit, L2.reg))) %>%
tidyr::drop_na()
data_valid <- data_valid %>%
dplyr::mutate_at(.vars = c(L1.x, L2.unit, L2.reg), as.factor) %>%
dplyr::select(dplyr::all_of(c(y, L1.x, L2.x, L2.unit, L2.reg))) %>%
tidyr::drop_na()
I believe the below lines can be removed from run_lasso.R since it is now done in file auto_mrp.R.
Convert individual-level, geographic unit, and geographic region