random_linear_forest: Fitting linear random forest

View source: R/library--analysis_tools--lm_rand_forest--class_methods.R

random_linear_forestR Documentation

Fitting linear random forest

Description

This uses the linear tree model from party kit and bootstrapping to create linear random forests that work like a random forest but with the linear dynamics permuted with a linear method

Usage

random_linear_forest(
  data,
  num_tree,
  model_formula,
  num_features = NULL,
  na.action = na.roughfix,
  max_depth = 5,
  importance = FALSE,
  verbose = FALSE
)

Arguments

data

a dataframe containing the variables in the model

num_tree

numeric, the number of trees in the random forest.

model_formula

an object of class "formula": a symbolic description of the model to be fitted.

num_features

number of tree features in each tree. if left NULL rounded up square of the number of columns

na.action

passed to lmtree to handle missing data

max_depth

the max depth of each tree in the forest

importance

controls if the importance should be calculated and stored

verbose

If true it prints training progress

Value

random_linear_forest object trained using given data

Examples

data(Example_data, package = "Covid19Wastewater")
random_linear_forest(Example_data, 2, PMMoV ~ N1 + N2 | pcr_type)

Covid19Wastewater documentation built on Aug. 25, 2023, 1:07 a.m.