LoslegenKostenlos loslegen

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?

Diese Übung ist Teil des Kurses

Machine Learning in the Tidyverse

Kurs anzeigen

Anleitung zur Übung

  • 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

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# 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 = ___)
Code bearbeiten und ausführen