run_rf: Run a Random Forest model

Description Usage Arguments Examples

View source: R/run_rf.R

Description

Prepare and run a random forest model.

Usage

1
run_rf(data, predictor_vars, outcome_var, n_trees = 500, prob = FALSE)

Arguments

data

A dataframe

predictor_vars

A vector of predictors

outcome_var

A single outcome variable. Factor or numeric.

n_trees

Number of trees to be grown in ranger::num.trees

prob

Probability or response outcome? If TRUE, outcome variable must be a factor.

Examples

1
2
3
preds <- c("disp", "hp", "qsec")
response <- "carb"
mt_rf <- run_rf(mtcars, preds, response, prob = FALSE)

aedobbyn/dobtools documentation built on May 28, 2019, 2:33 a.m.