O'Reilly logo

R Data Analysis Cookbook - Second Edition by Kuntal Ganguly

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using a convenience function to compute the RMS error

The following function may be handy when we need to compute the RMS error:

rdahb.rmse <- function(actual, predicted) { 
  return (sqrt(mean((actual-predicted)^2))) 
} 

Armed with the function, we can compute the RMS error as follows:

> rmse <- rdahb.rmse(dat$price, dat$pred) 

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required