View source: R/predict_simple.R
predict_simple_fn | R Documentation |
predict_simple_fn()
does simple linear interpolation and flat extrapolation
on specified columnn in a data frame using zoo::na.approx()
.
predict_simple_fn(
df,
model,
col,
test_col = NULL,
group_col = NULL,
obs_filter = NULL,
pred_col = "pred",
sort_col = NULL,
sort_descending = FALSE
)
df |
Data frame of model data. |
model |
Type of simple extrapolation or interpolation to perform:
|
col |
Name of column to extrapolate/interpolate. |
test_col |
Name of logical column specifying which response values to remove
for testing the model's predictive accuracy. If |
group_col |
Column name(s) of group(s) to use in |
obs_filter |
String value of the form " If `group_models = FALSE`, then `obs_filter` is only used to determine when predicted values replace observed values but **is not** used to restrict values from being used in model fitting. If `group_models = TRUE`, then a model is only fit for a group if they meet the `obs_filter` requirements. This provides speed benefits, particularly when running INLA time series using `predict_inla()`. |
pred_col |
Column name to store predicted value. |
sort_col |
Column name(s) to use to dplyr::arrange() the data prior to
supplying type and calculating mean absolute scaled error on data involving
time series. If NULL, not used. Defaults to "year". For |
sort_descending |
Logical value on whether the sorted values from |
A data frame.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.