Chapter 13 Last fit and evaluation

Fit the final best model to the training set and evaluate the test set with the function last_fit():

last_fit_lm <- last_fit(lm_wflow, split = new_split)

# Show RMSE and RSQ
last_fit_lm %>% 
  collect_metrics()
## # A tibble: 2 x 4
##   .metric .estimator .estimate .config             
##   <chr>   <chr>          <dbl> <chr>               
## 1 rmse    standard   69259.    Preprocessor1_Model1
## 2 rsq     standard       0.632 Preprocessor1_Model1