model_rf: Build a forecasting model for counts using random forest,...

View source: R/random_forest_model.R

model_rfR Documentation

Build a forecasting model for counts using random forest, benchmarked against our standard GLM approach. Forecasting for random forest is performed recursively so that we can compare models over the training data.

Description

Build a forecasting model for counts using random forest, benchmarked against our standard GLM approach. Forecasting for random forest is performed recursively so that we can compare models over the training data.

Usage

model_rf(
  dat,
  train_start,
  test_start,
  forecast_start,
  horizon,
  lag_order,
  seed = NULL
)

Arguments

dat

Dataframe for a single species as prepared by prep_dat_glm.

train_start

First YrQtr for train set.

test_start

First YrQtr for test set.

forecast_start

First YrQtr for forecast set.

horizon

Number of survey periods to forecast.

lag_order

Number of lags to include in model.

seed

Optional seed to set so that random forest results can be replicated.

Value

Dataframe with random forest train/test predictions and glm benchmark train/test predictions.


BibelnieksDFW/BrBS documentation built on April 20, 2022, 12:54 a.m.