rmse

0th

Percentile

Root Mean Squared Error

rmse computes the root mean squared error between two numeric vectors

Usage
rmse(actual, predicted)
Arguments
actual

The ground truth numeric vector.

predicted

The predicted numeric vector, where each element in the vector is a prediction for the corresponding element in actual.

See Also

mse

Aliases
  • rmse
Examples
# NOT RUN {
actual <- c(1.1, 1.9, 3.0, 4.4, 5.0, 5.6)
predicted <- c(0.9, 1.8, 2.5, 4.5, 5.0, 6.2)
rmse(actual, predicted)
# }
Documentation reproduced from package Metrics, version 0.1.4, License: BSD_3_clause + file LICENSE

Community examples

action781@gmail.com at Apr 10, 2018 Metrics v0.1.2

Split mtcars dataframe into train and test set ``` r train <- mtcars[1:24,] test <- mtcars[25:32,] ``` Create multivariate model for mpg depending on weight and hp ``` r mod1 <- lm(mpg ~ wt + hp, data = train) ``` See predictions on test set ``` r predictions <- predict(mod1, test) ``` Calculate RMSE ``` r rmse(test$mpg, predictions) ```