CommencerCommencer gratuitement

Best and worst fitting models

In this exercise you will answer the following questions:

  • Overall, how well do your models fit your data?
  • Which are the best fitting models?
  • Which models do not fit the data well?

Cet exercice fait partie du cours

Machine Learning in the Tidyverse

Afficher le cours

Instructions

  • Plot a histogram of the \(R^2\) values of the 77 models
  • Extract the 4 best fitting models (based on \(R^2\)) and store this data frame as best_fit
  • Extract the 4 worst fitting models (based on \(R^2\)) and store this data frame as worst_fit

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Plot a histogram of rsquared for the 77 models    
model_perf %>% 
  ggplot(aes(x = ___)) + 
  ___()  
  
# Extract the 4 best fitting models
best_fit <- model_perf %>% 
  slice_max(___, n = ___)

# Extract the 4 models with the worst fit
worst_fit <- model_perf %>% 
  slice_min(___, n = ___)
Modifier et exécuter le code