do.rf: A random forest based disease forecasting approach

Description Usage Arguments Details Value

View source: R/rf1_main.R

Description

The do.rf function runs the random forest portion of the code

Usage

1
2
3
4
5
do.rf(trap.data, dep.var, independent.vars, results.path, do.spatial = 0,
  create.ci.null = 0, label = "", response.type = "continuous",
  exploratory = TRUE, input.seed = 20180830, temporal.field = "year",
  spatial.field = "location", quantile.model = 1,
  display.messages = 1)

Arguments

trap.data

A data frame containing human cases, mosquito infection rate (if applicable), and independent variables for prediction of human cases and/or mosquito infection rates

dep.var

The field name containing the dependent variable to analyze

independent.vars

The field names of the independent variables to include in the analysis Variables not listed here but present in the data frame will be excluded from the analysis.

results.path

The base path in which to place the modeling results. Some models will create sub-folders for model specific results

do.spatial

Whether or not to do spatial crossvalidation (can be time-consuming)

create.ci.null

Whether or not to generate null model results

label

A label for the analysis run

response.type

Whether data should be treated as continuous (mosquito rates, number of cases) or binary (0 or 1).

exploratory

Whether to identify the best model (exploratory = TRUE), or whether to run the random forest with all input independent variables (exploratory = FALSE)

input.seed

A seed for the random number generator to ensure that the results are repeatable

temporal.field

The field containing the temporal units

spatial.field

The field containing the spatial units

quantile.model

Whether (1) or not (0) to use a quantile random forest for the final model output. All other calculations and model fitting use the standard randomForest package.

display.messages

Whether or not update messages should be output

Details

Majority of code was writen in wnv_hlpr.R; January - June 2018. Transferred to this file & modified beginning in March 2019. Code adapted to use common inputs with the ArboMAP code of Davis & Wimberly

Value

A list containing:

MODEL the random forest prediction model
TEMPORAL.ACCURACY an accuracy assessment using leave one year out cross-validation
SPATIAL.ACCURACY an accuracy assessment based on leave one location out cross-validation
TEMPORAL.NULL Null model results based on estimates across time
SPATIAL.NULL Null model results based on estimates across space
RETAINED.VARS Variables retained in the final prediction model

akeyel/rf1 documentation built on Dec. 28, 2020, 4:48 a.m.