OTClass: Train the ensemble of optimal trees for classification.

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/OTClass.R

Description

This function selects optimal trees for classification from a total of t.initial trees grown by random forest. Number of trees in the initial set, t.initial, is specified by the user. If not specified then the default t.initial = 1000 is used.

Usage

1
2
OTClass(XTraining, YTraining, method=c("oob+independent","oob","sub-sampling"),
p = 0.1,t.initial = NULL,nf = NULL, ns = NULL, info = TRUE)

Arguments

XTraining

An n x d dimensional training data matrix/frame consiting of traing observation where n is the number of observations and d is the number of features.

YTraining

A vector of length n consisting of class labels for the training data. Should be binary (0,1).

method

Method used in the selection of optimal trees. method="oob+independent" used out-of-bag observation from the bootstrap sample taken for growing the individual tree for indidual tree assessment while an independent training data for their collective assessement. method="oob" use the out-of-bag observations both for individual and collective assessment. method="sub-sampling" uses a sub-sample of the training data for individual tree assessment as well as its contribution towards the ensemble.

p

Percent of the best t.initial trees to be selected on the basis of performance on out-of-bag observations.

t.initial

Size of the initial set of classification trees.

nf

Number of features to be sampled for spliting the nodes of the trees. If equal to NULL then the default sqrt(number of features) is executed.

ns

Node size: Minimal number of samples in the nodes. If equal to NULL then the default 1 is executed.

info

If TRUE, displays processing information.

Details

Large values are recommended for t.initial for better performance as possible under the available computational resources.

Value

A trained object consisting of the selected trees.

Note

Prior action needs to be taken in the case of missing values as the fuction can not handle them at the current version.

Author(s)

Zardad Khan <zkhan@essex.ac.uk>

References

Khan, Z., Gul, A., Perperoglou, A., Miftahuddin, M., Mahmoud, O., Adler, W., & Lausen, B. (2019). Ensemble of optimal trees, random forest and random projection ensemble classification. Advances in Data Analysis and Classification, 1-20.

Liaw, A. and Wiener, M. (2002) “Classification and regression by random forest” R news. 2(3). 18–22.

See Also

Predict.OTClass, OTReg, OTProb

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#load the data

  data(Body)
  data <- Body

#Divide the data into training and test parts

  set.seed(9123)
  n <- nrow(data)
  training <- sample(1:n,round(2*n/3))
  testing <- (1:n)[-training]
  X <- data[,1:24]
  Y <- data[,25]

#Train OTClass on the training data

  Opt.Trees <- OTClass(XTraining=X[training,],YTraining = Y[training],
  t.initial=200,method="oob+independent")

#Predict on test data

  Prediction <- Predict.OTClass(Opt.Trees, X[testing,],YTesting=Y[testing])

#Objects returned

  names(Prediction)
  Prediction$Confusion.Matrix
  Prediction$Predicted.Class.Labels

OTE documentation built on April 20, 2020, 5:05 p.m.