평균 제곱근 오차 (RMSE)

R로 하는 Supervised Learning: 회귀

Nina Zumel and John Mount

Win-Vector LLC

평균 제곱근 오차 (RMSE)란?

$$ RMSE = \sqrt{\overline{(y-pred)^2}} $$

여기서

  • $y - pred$: 오차 또는 잔차 벡터
  • $\overline{(y-pred)^2}$: $(y-pred)^2$의 평균값
R로 하는 Supervised Learning: 회귀

주택 판매 가격 모델의 RMSE

# Calculate error
err <- houseprices$prediction - houseprices$price
  • price: 실제 판매 가격 열 (단위: 천)
  • prediction: 예측 판매 가격 열 (단위: 천)
R로 하는 Supervised Learning: 회귀

주택 판매 가격 모델의 RMSE

# Calculate error
err <- houseprices$prediction - houseprices$price

# Square the error vector
err2 <- err^2
R로 하는 Supervised Learning: 회귀

주택 판매 가격 모델의 RMSE

# Calculate error
err <- houseprices$prediction - houseprices$price

# Square the error vector
err2 <- err^2

# Take the mean, and sqrt it
(rmse <- sqrt(mean(err2)))
58.33908
  • $RMSE \approx 58.3$
R로 하는 Supervised Learning: 회귀

RMSE는 큰 값인가, 작은 값인가?

# Take the mean, and sqrt it
(rmse <- sqrt(mean(err2)))
58.33908
# The standard deviation of the outcome
(sdtemp <- sd(houseprices$price))
135.2694
  • $RMSE \approx 58.3$
  • $sd(price) \approx 135$
R로 하는 Supervised Learning: 회귀

연습해 봅시다!

R로 하는 Supervised Learning: 회귀

Preparing Video For Download...