selectrfnumtrees: Tuning number of trees hyperparameter. Trains random forests...

Description Usage Arguments Value Examples

View source: R/hyperparameters.R

Description

Tuning number of trees hyperparameter. Trains random forests with a range of number of trees so the optimal number can be identified (using the resulting plot) with cross validation

Usage

1
2
3
4
5
6
7
selectrfnumtrees(
  data,
  maxnum = 100,
  title = "",
  showplots = TRUE,
  output_prefix = ""
)

Arguments

data

Dataset: dataframe containing classification column and all other column features. Both the training and test datasets will be taken from this dataset.

maxnum

Maximum number of trees to be considered. All numbers between 1 and maxnum will be considered. Default: 100.

title

Title to be used for the resulting boxplot

showplots

TRUE if plots should be shown in standard output, FALSE is plots should be saved as jpg files. Default: TRUE.

output_prefix

Prefix used for saving plots. If showplots==FALSE then plots are saved here. Otherwise, standard output.

Value

Dataframe containing test and training accuracy, sensitivity and specificity

Examples

1
2
3
4
5
data = read.csv(paste(system.file('samples/subsamples', package = "feamiR"),'/sample0.csv',sep=''))
data = rbind(head(data,50),tail(data,50))
data$classification = as.factor(data$classification)
data = data[,2:ncol(data)]
selectrfnumtrees(data,5,'RF boxplots')

feamiR documentation built on Jan. 19, 2021, 9:08 a.m.