8.60 Evaluate the model
This model has similar performance compared to the bagging model.
augment(rf_fit, new_data = carseats_train) %>%
rmse(truth = Sales, estimate = .pred)
## # A tibble: 1 × 3
## .metric .estimator .estimate
## <chr> <chr> <dbl>
## 1 rmse standard 0.858
augment(rf_fit, new_data = carseats_test) %>%
rmse(truth = Sales, estimate = .pred)
## # A tibble: 1 × 3
## .metric .estimator .estimate
## <chr> <chr> <dbl>
## 1 rmse standard 1.36
Training RMSE: 0.858 Testing RMSE: 1.36 (still overfitting)
We can likewise plot the true value against the predicted value.
augment(rf_fit, new_data = carseats_test) %>%
ggplot(aes(Sales, .pred)) +
geom_abline() +
geom_point(alpha = 0.5)