Generic calculate_rmse()
returns the root mean square error for the given
input.
calculate_rmse(x, ...)
# S3 method for default
calculate_rmse(x, ...)
# S3 method for trending_model
calculate_rmse(x, data, na.rm = TRUE, as_tibble = TRUE, ...)
# S3 method for list
calculate_rmse(x, data, na.rm = TRUE, ...)
# S3 method for trending_fit
calculate_rmse(x, new_data, na.rm = TRUE, as_tibble = TRUE, ...)
# S3 method for trending_fit_tbl
calculate_rmse(x, new_data, na.rm = TRUE, ...)
# S3 method for trending_predict
calculate_rmse(x, na.rm = TRUE, as_tibble = TRUE, ...)
# S3 method for trending_predict_tbl
calculate_rmse(x, na.rm = TRUE, ...)
# S3 method for trending_prediction
calculate_rmse(x, na.rm = TRUE, as_tibble = TRUE, ...)
An R object.
Not currently used.
a data.frame
containing data (including the response variable
and all predictors) used in the specified model.
Should NA values should be removed before calculation of metric (passed to the underlying function yardstick::rmse_vec).
Should the result be returned as tibble
(as_tibble = TRUE
) or a list (as_tibble = FALSE
).
a data.frame
containing data (including the response variable
and all predictors) on which to assess the model.
For a single trending_fit
input, if
as_tibble = FALSE
the object returned will be a list with entries:
metric: "rmse"
result: the resulting rmse value (NULL if the calculation failed)
warnings: any warnings generated during calculation
errors: any errors generated during calculation
If as_tibble = TRUE
, or for the other trending
classes, then the output
will be a tibble with one row for each fitted model
columns corresponding to output generated with single model input.
Specific methods are given for trending_model
(and lists of
these), trending_fit
,
trending_fit_tbl
,
trending_predict_tbl
,
trending_predict_tbl
and
trending_prediction
objects. Each of these are simply wrappers around the
yardstick::rmse_vec with the addition of explicit error handling.