Skip to contents

This function takes the output of tune_dw_model() and uses the best_params defined within. This is a convenient wrapper around build_dw_model() if you have already run tune_dw_model() and are broadly happy with the parameters it has chosen. That being said, the params argument can be used to override specific hyperparameters.

Usage

finalise_tdw_model(tdw, data, params = list(), ..., .date = "date")

Arguments

tdw

A deweather tuning object created with tune_dw_model().

data

An input data.frame containing one pollutant column (defined using pollutant) and a collection of feature columns (defined using vars). This must be provided in addition to tdw as it is expected most users will have provided tune_dw_model() with a sampled dataset.

params

A named list. These parameters are used to override the best_params defined within tdw. For example, if the 'best' parameter for trees is 50, params = list(trees = 100) will set it to 100 instead. This also includes engine-specific parameters (e.g., lambda for the xgboost engine).

...

Not currently used. To add engine-specific models, add them to tune_dw_model() and they will be picked up automatically, or use build_dw_model() directly.

.date

The name of the 'date' column which defines the air quality timeseries. Passed to append_dw_vars() if needed. Also used to extract the time zone of the data for later restoration if trend is used as a variable.

See also

Author

Jack Davison