การพยากรณ์หลังจาก Fit โมเดล

Supervised Learning ใน R: การถดถอย

Nina Zumel and John Mount

Win-Vector LLC

การพยากรณ์จากข้อมูล Training

cricket$prediction <- predict(cmodel)
  • predict() จะคืนค่าพยากรณ์จากข้อมูล Training โดยค่าเริ่มต้น
Supervised Learning ใน R: การถดถอย

ดูผลการพยากรณ์

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

Supervised Learning ใน R: การถดถอย

การพยากรณ์บนข้อมูลใหม่

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

Supervised Learning ใน R: การถดถอย

มาฝึกกันเถอะ!

Supervised Learning ใน R: การถดถอย

Preparing Video For Download...