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)