View source: R/rmw_normalise.R
rmw_normalise | R Documentation |
Function to normalise a variable for "average" meteorological conditions.
rmw_normalise(
model,
df,
variables = NA,
n_samples = 300,
replace = TRUE,
se = FALSE,
aggregate = TRUE,
keep_samples = FALSE,
n_cores = NA,
verbose = FALSE
)
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? |
Tibble.
Stuart K. Grange
rmw_prepare_data
, rmw_train_model
# 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
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.