Learn R Programming

pomodoro (version 3.8.0)

RF_Model: Random Forest

Description

Random Forest

Usage

RF_Model(Data, xvar, yvar)

Arguments

Data

The name of the Dataset.

xvar

X variables.

yvar

Y variable.

Value

The output from RF_Model.

Details

Rather than considering the random sample of \(m\) predictors from the total of \(p\) predictors in each split, random forest does not consider a majority of the \(p\) predictors, and considers in each split a fresh sample of \(m_{try}\) which we usually set to \(m_{try} \approx \sqrt{p}\) Random forests which de-correlate the trees by considering \(m_{try} \approx \sqrt{p}\) show an improvement over bagged trees \(m = p\).

Examples

Run this code
# NOT RUN {
sample_data <- sample_data[c(1:750),]
yvar <- c("Loan.Type")
xvar <- c("sex", "married", "age", "havejob", "educ", "political.afl",
"rural", "region", "fin.intermdiaries", "fin.knowldge", "income")
BchMk.RF <- RF_Model(sample_data, c(xvar, "networth"), yvar )
BchMk.RF
 
# }

Run the code above in your browser using DataLab