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.
Este ejercicio forma parte del curso
Machine Learning with Tree-Based Models in R
Ejercicio interactivo práctico
Prueba este ejercicio completando el código de muestra.
# 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 <- ___ / ___
___