BaşlayınÜcretsiz Başlayın

Glance at the fit of your models

In this exercise you will use glance() to calculate how well the linear models fit the data for each country.

Bu egzersiz

Machine Learning in the Tidyverse

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Append a column (fit) containing the fit statistics for each model to the gap_models data frame and save it as model_perf_nested.
  • Simplify this data frame using unnest() to extract these fit statistics of each model and save it as model_perf.
  • Finally, use head() to take a peek at model_perf.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Extract the fit statistics of each model into data frames
model_perf_nested <- gap_models %>% 
    mutate(fit = map(model, ~___(.x)))

# Simplify the fit data frames for each model    
model_perf <- model_perf_nested %>% 
    unnest(___)
    
# Look at the first six rows of model_perf
head(___)
Kodu Düzenle ve Çalıştır