04pallav
9/13/2017 - 9:35 PM

Mean square error and R2

Mean square error

#install.packages("Metrics")
library(Metrics)
mse(actual, predicted)

R2 <- function(actual,predict) { 1 - (sum((actual-predict )^2)/sum((actual-mean(actual))^2)) }
R2(currframe$actual,currframe$predicted)