Chapter 18 Model building

Let’s use some classification algorithms to model the flight data. We start by building some models using the parsnip package:

18.1 Logistic regression

lr_mod <- 
  logistic_reg() %>% 
  set_engine("glm")

18.2 Decision tree

dt_mod <- 
  decision_tree() %>% 
  set_engine("C5.0") %>% 
  set_mode("classification")

18.3 Random forest

rf_mod <- 
  rand_forest() %>% 
  set_engine("ranger") %>% 
  set_mode("classification")

18.4 Boosted tree (XGBoost)

#install.packages("xgboost")

xgb_mod <- 
  boost_tree() %>% 
  set_engine("xgboost") %>% 
  set_mode("classification")