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

Evaluate a random forest model

Similar to the linear regression model, you will use the MAE metric to evaluate the performance of the random forest model.

Bu egzersiz

Machine Learning in the Tidyverse

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

Egzersiz talimatları

  • Calculate the MAE by comparing the actual with the predicted values for the validate data and assign it to the validate_mae column.
  • Print the validate_mae column (note how they vary).
  • Calculate the mean of this column.

Note: The actual values of the validate fold (validate_actual) has already been added to your cv_data data frame.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

library(ranger)

# Calculate validate MAE for each fold
cv_eval_rf <- cv_prep_rf %>% 
  mutate(validate_mae = map2_dbl(___, ___, ~mae(actual = .x, predicted = .y)))

# Print the validate_mae column
___

# Calculate the mean of validate_mae column
___
Kodu Düzenle ve Çalıştır