rf_pt: Custom function for regression by Random Forest with...

Description Usage Arguments Value Author(s)

Description

This function takes training data, tesing data, target variable, tuning parameters, and predict target variable of the training data by Random Forest model with Parameter Tuning.

Usage

1
2
3
4
5
6
7
8
rf_pt_reg(train,test,target,
drop = NULL,num_trials=10,
mtry=c(1:7),
ntree=c(50,100,200,500,700),
maxnodes=c(5,10,15,20,30,50),
nodesize=c(1,2,5,10),
type='NULL'
)

Arguments

train

Training Data as a dataframe.

test

Testing Data as a dataframe.

target

Name of the variable that needs to predict

drop

Name of the variable that needs to be dropped before building the model.

num_trials

Total number of trails to find best combination of Random Forest Tuning parameters causing minimum error

mtry

Random Forest uning parameter: number of predictors sampled for spliting at each node.Default is c(1:7)

ntree

Random Forest Tuning parameter: number of trees grown.Default is c(50,100,200,500,700).

maxnodes

Random Forest Tuning parameter: The size of the tree. Default is c(5,10,15,20,30,50)

nodesize

Random Forest Tuning parameter: Max number of terminal nodes.Default is c(1,2,5,10)

type

if type = "tuning", it will return the least error with best value of the best parameter combination,any other value will return the prediction on testing data.

Value

The value returns from this function is a numeric vector.

Author(s)

ABIR CHAKRABORTY < mail2abirchakraborty@gmail.com >


AbirChakraborty1/RegFunction documentation built on Feb. 25, 2022, 12:22 p.m.