9.2 Predicting the future

9.2.1 Dengue Test Predictions for 2017-2021

Test of the Dengue’s model made with mlr3 meta-package in Chapter 8.

new_data <- hmsidwR::infectious_diseases %>%
  arrange(year)%>%
  filter(cause_name == "Dengue",
         year>=2017,
         !location_name %in% c("Eswatini", "Lesotho")) %>%
  drop_na() %>%
  group_by(location_id) %>%
  select(-location_name, -cause_name)
new_pred_regr.cv_glmnet <- 
  rr1$learners[[1]]$predict_newdata(new_data,
                                    task = rr1$task)

new_pred_regr.xgboost <- 
  rr2$learners[[1]]$predict_newdata(new_data,
                                    task = rr2$task)