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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.