mse {ModelMetrics} | R Documentation |
Mean Square Error
Description
Calculates the mean square error
Usage
mse(...)
## Default S3 method:
mse(actual, predicted, ...)
## S3 method for class 'lm'
mse(modelObject, ...)
## S3 method for class 'glm'
mse(modelObject, ...)
Arguments
... |
additional parameters to be passed the the s3 methods |
actual |
A vector of the labels |
predicted |
A vector of predicted values |
modelObject |
the model object. Currently supported |
Examples
data(testDF)
glmModel <- glm(y ~ ., data = testDF, family="binomial")
Preds <- predict(glmModel, type = 'response')
mse(testDF$y, Preds)
[Package ModelMetrics version 1.2.2.2 Index]