rmse: Calculate root mean squared error.

Description Usage Arguments Value Examples

View source: R/errors.R

Description

rmse takes actual and forecast numeric vectors and returns a numeric vector where forecast is subtracted from the actual, the errors are then squared, the average of those squared error is taken, and lastly, the root taken of that mean squared error value.

Usage

1
2
rmse(y_true = NULL, y_pred = NULL, actual = NULL, forecast = NULL,
  na.rm = TRUE, ...)

Arguments

y_true

Ground truth (correct) target values.

y_pred

Estimated target values.

actual

a numeric vector of actuals.

forecast

a numeric vector of forecasts.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

...

additional arguments to be passed to mean()

Value

a numeric vector of length one: the mean of of absolute percent errors.

Examples

1
2
# Examples
rmse(1:100, 100:1)

Example output

[1] 57.73214
Warning messages:
1: In rmse(1:100, 100:1) :
  'rmse' is deprecated. Use 'mean_squared_error' instead.
2: In e(actual, forecast) :
  'e' is deprecated. Use 'absolute_error' instead.

scorer documentation built on May 2, 2019, 3:22 a.m.