Out-of-sample performance
In-sample performance provides insights about how well a model captures the data it is modeling. For predictive models, it's also important to check model performance on new, unseen data, the out-of-sample performance.
In this exercise, you will check the test set predictions of your model using MAE (mean absolute error).
Pre-loaded in your workspace again is the model that you built and used in the last exercises.
Diese Übung ist Teil des Kurses
Machine Learning with Tree-Based Models in R
Anleitung zur Übung
- Use
modelto predict the out-of-samplefinal_gradeand add your predictions tochocolate_testusingbind_cols(). - Calculate the mean absolute error using a
yardstickfunction.
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
# Predict ratings on test set and add true grades
test_enriched <- predict(__, new_data = ___) %>%
bind_cols(___)
# Compute the mean absolute error using one single function
___(___,
___,
___)