Learn R Programming

Covid19Wastewater (version 1.0.1)

random_linear_forest: 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
)

Value

random_linear_forest object trained using given data

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

Examples

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

Run the code above in your browser using DataLab