Обучение с учителем в R: регрессия
Nina Zumel and John Mount
Win-Vector LLC
$$ RMSE = \sqrt{\overline{(y-pred)^2}} $$
где
# Calculate error
err <- houseprices$prediction - houseprices$price
price: столбец фактических цен продажи (в тысячах)prediction: столбец прогнозируемых цен продажи (в тысячах)# Calculate error
err <- houseprices$prediction - houseprices$price
# Square the error vector
err2 <- err^2
# 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
# Take the mean, and sqrt it
(rmse <- sqrt(mean(err2)))
58.33908
# The standard deviation of the outcome
(sdtemp <- sd(houseprices$price))
135.2694
Обучение с учителем в R: регрессия