モデルのフィッティング後の予測

R による Supervised Learning:回帰

Nina Zumel and John Mount

Win-Vector LLC

トレーニングデータからの予測

cricket$prediction <- predict(cmodel)
  • predict() はデフォルトでトレーニングデータの予測値を返す
R による Supervised Learning:回帰

予測結果の確認

ggplot(cricket, aes(x = prediction, y = temperature)) + 
     geom_point() +
     geom_abline(color = "darkblue") + 
     ggtitle("temperature vs. linear model prediction")

R による Supervised Learning:回帰

新しいデータへの予測

newchirps <- data.frame(chirps_per_sec = 16.5)
newchirps$prediction <- predict(cmodel, newdata = newchirps)
newchirps
   chirps_per_sec     pred
 1           16.5 79.53537

R による Supervised Learning:回帰

さあ、練習しましょう!

R による Supervised Learning:回帰

Preparing Video For Download...