testMod | R Documentation |
Function to test different meteorological normalisation models.
testMod(
input_data,
vars = c("trend", "ws", "wd", "hour", "weekday", "air_temp"),
pollutant = "nox",
train.frac = 0.8,
n.trees = NA,
shrinkage = 0.1,
interaction.depth = 5,
bag.fraction = 0.5,
n.minobsinnode = 10,
cv.folds = 5,
seed = 123,
n.core = 4,
plot = TRUE
)
input_data |
Data frame to analyse. Must contain a POSIXct field called
|
vars |
Explanatory variables to use. These variables will be used to
build the |
pollutant |
The name of the variable to apply meteorological normalisation to. |
train.frac |
Fraction of data to train a model on. The model is tested against the withheld 0.2 proportion. |
n.trees |
Number of trees to use. If |
shrinkage |
A shrinkage parameter applied to each tree in the expansion.
Also known as the learning rate or step-size reduction; |
interaction.depth |
Integer specifying the maximum depth of each tree
(i.e., the highest level of variable interactions allowed). A value of |
bag.fraction |
The fraction of the training set observations randomly
selected to propose the next tree in the expansion. This introduces
randomness into the model fit. If |
n.minobsinnode |
Integer specifying the minimum number of observations in the terminal nodes of the trees. Note that this is the actual number of observations, not the total weight. |
cv.folds |
Number of cross-validation folds to perform. If |
seed |
Random number seed for reproducibility in returned model. |
n.core |
Number of cores to use for parallel processing. |
plot |
The default, |
Returns to be added.
David Carslaw
buildMod()
for fitting a final model
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.