Root-mean-square error (RMSE)

We have already computed the squared error from the data, so to compute the root-mean-square error (RMSE), all we need to do is call SQL in order to take the average squared error for each outcome. We can see that there is much more variation in predicted outcome=1 (diabetes) than there is for predicting outcome=0:

result <- sql("select outcome,avg(errorsqr) from preds_tbl group by 1")display(result)

Get Practical Predictive Analytics now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.