모델 적합 후 예측하기

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...