powered by
Calculates the mean square error
mse(...)# S3 method for default mse(actual, predicted, ...)# S3 method for lm mse(modelObject, ...)# S3 method for glm mse(modelObject, ...)
# S3 method for default mse(actual, predicted, ...)
# S3 method for lm mse(modelObject, ...)
# S3 method for glm mse(modelObject, ...)
additional parameters to be passed the the s3 methods
A vector of the labels
A vector of predicted values
the model object. Currently supported lm
lm
# NOT RUN { data(testDF) glmModel <- glm(y ~ ., data = testDF, family="binomial") Preds <- predict(glmModel, type = 'response') mse(testDF$y, Preds) # }
Run the code above in your browser using DataLab