rmw_normalise {rmweather} | R Documentation |
Function to normalise a variable for "average" meteorological conditions.
Description
Function to normalise a variable for "average" meteorological conditions.
Usage
rmw_normalise(
model,
df,
variables = NA,
n_samples = 300,
replace = TRUE,
se = FALSE,
aggregate = TRUE,
keep_samples = FALSE,
n_cores = NA,
verbose = FALSE
)
Arguments
model |
A ranger model object from |
df |
Input data used to calculate |
variables |
Variables to randomly sample. Default is all variables used
for training the model with the exception of |
n_samples |
Number of times to sample |
replace |
Should |
se |
Should the standard error of the predictions be calculated too? The standard error method is the "infinitesimal jackknife for bagging" and will slow down the predictions significantly. |
aggregate |
Should all the |
keep_samples |
When |
n_cores |
Number of CPU cores to use for the model predictions. Default is system's total minus one. |
verbose |
Should the function give messages and display a progress bar? |
Value
Tibble.
Author(s)
Stuart K. Grange
See Also
rmw_prepare_data
, rmw_train_model
Examples
# Load package
library(dplyr)
# Keep things reproducible
set.seed(123)
# Prepare example data
data_london_prepared <- data_london %>%
filter(variable == "no2") %>%
rmw_prepare_data()
# Normalise the example no2 data
data_normalised <- rmw_normalise(
model_london,
df = data_london_prepared,
n_samples = 300,
verbose = TRUE
)