Среднеквадратичная ошибка (RMSE)

Обучение с учителем в R: регрессия

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: регрессия

RMSE модели цен на жильё

# Calculate error
err <- houseprices$prediction - houseprices$price
  • price: столбец фактических цен продажи (в тысячах)
  • prediction: столбец прогнозируемых цен продажи (в тысячах)
Обучение с учителем в R: регрессия

RMSE модели цен на жильё

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

# Square the error vector
err2 <- err^2
Обучение с учителем в R: регрессия

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: регрессия

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: регрессия

Давайте потренируемся!

Обучение с учителем в R: регрессия

Preparing Video For Download...