Learn R Programming

ModelMetrics (version 1.2.2.2)

rmse: Root-Mean Square Error

Description

Calculates the root mean square error

Usage

rmse(...)

# S3 method for default rmse(actual, predicted, ...)

# S3 method for lm rmse(modelObject, ...)

# S3 method for glm rmse(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 lm

Examples

Run this code
# NOT RUN {
data(testDF)
glmModel <- glm(y ~ ., data = testDF, family="binomial")
Preds <- predict(glmModel, type = 'response')

rmse(testDF$y, Preds)

# }

Run the code above in your browser using DataLab