calculate_model: Function to model pollutant concentrations based on...

Description Usage Arguments Value Author(s) See Also Examples

Description

To-do: Support for models other than random forest is pretty poor at the moment, this needs to be fixed.

Usage

1
2
calculate_model(list_input_data, variables, model = "rf", ntree = NA,
  mtry = 3, nodesize = 3, verbose = TRUE, output = NA)

Arguments

list_input_data

normalweatherr_data list containing the prepared training and testing sets; produced by split_input_data.

variables

Variables to include in the model.

model

Model type to use. Can be: "rf", "svm", "gam", "gbm" for random forest, support vector machines, generalised additive models, and generalised boosted regression models respectively.

ntree

Number of trees to grow for "rf" or "gbm" models. Set ntree to a smaller integer for testing.

mtry

Number of variables randomly sampled for splitting the "rf" decision tree.

nodesize

Minimum size of terminal nodes for the "rf" model.

verbose

Should the models print progress if this is supported?

output

File name to export the model object as an .rds file. If not used, the model will not be exported to disc. Directories will be created if necessary.

Value

Named list containing two data frames (contents of list_input_data) and a model object with the class normalweatherr_model.

Author(s)

Stuart K. Grange

See Also

split_input_data, normalise_for_meteorology

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 

# Calculate a random forest model
list_model <- calculate_model(
  list_input_data = list_input_data, 
  variables = variables, 
  model = "rf",
  ntree = 200,
  output = NA,
  mtry = 5,
  nodesize = 1,
  verbose = TRUE
)


## End(Not run)

skgrange/normalweatherr documentation built on May 23, 2019, 9:34 a.m.