Are you predicting correctly?
Your model should be as good as possible, right? One way you can assess this is by counting how often it predicted the correct classes compared to the total number of predictions it made. As discussed in the video, we call this performance measure accuracy. You can either calculate this manually or by using a handy shortcut. Both obtain the same result.
The confusion matrix diabetes_matrix and the tibble predictions_combined are loaded.
Cet exercice fait partie du cours
Machine Learning with Tree-Based Models in R
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
# Calculate the number of correctly predicted classes
correct_predictions <- 75 + ___
# Calculate the number of all predicted classes
all_predictions <- ___ + ___ + 18 + ___
# Calculate and print the accuracy
acc_manual <- ___ / ___
___