tuneMTRY: Tuning of the mtry parameter for a Random Forest model

Description Usage Arguments Details Value Author(s) Examples

View source: R/RFTuning.R

Description

tuneMTRY tries to identify the 'optimal' value of the mtry parameter which indicates the number of input variables randomly chosen at each node

Usage

1
2
tuneMTRY(data, iterations, maxntree, mtry_length, changeTreeNum = F,
  graph = T)

Arguments

data

the n x p dataframe used to build the models and to tune the parameter mtry. The first two columns must represent respectively the sample names and the class labels related to each sample

iterations

the number of different random forest models built for each value of mtry

maxntree

the maximum number of trees of each random forest model

mtry_length

an integer value representing the number of mtry values to test.

changeTreeNum

a logical value indicating whether or not to change

graph

a logical value indicating whether to plot the OOB error as a function of the parameter mtry the number of trees during the tuning of mtry

Details

The function searches for the optimal value of mtry assigning to it a set of values and building different random forests (also with a different number of trees) for each value of the mtry. The number of models built for each mtry is defined by the iteration parameter. The oob errors of each random forest model, computed for each mtry value, are then arranged in a matrix

Value

a list of two elements:

Author(s)

Piergiorgio Palla

Examples

1
2
## data(cachexiaData)
## res <- tuneMTRY(cachexiaData, iterations = 10, maxntree = 600, mtry_length = 10, graph = FALSE)

pjpalla/RFmarkerDetector documentation built on May 25, 2019, 8:19 a.m.