Predict.OTProb: Prediction function for the object returned by 'OTProb'

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

View source: R/Predict.OTProb.R

Description

This function provides prediction for test data on the trained OTProb object for class membership probability estimation.

Usage

1
Predict.OTProb(Opt.Trees, XTesting, YTesting)

Arguments

Opt.Trees

An object of class OptTreesEns.

XTesting

An m x d dimensional training data matrix/frame consiting of test observations where m is the number of observations and d is the number of features.

YTesting

Optional. A vector of length m consisting of class labels for the test data. Should be binary (0,1).

Value

A list with values

Brier.Score

Brier Score based on the estimated probabilities and true class label in YTesting.

Estimated.Probabilities

A vector of length m consisting of the estimated class membership probabilities for the observation in XTesting

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

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
29
#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 <- OTProb(XTraining=X[training,],YTraining = Y[training],t.initial=200)
  
#Predict on test data

  Prediction <- Predict.OTProb(Opt.Trees, X[testing,],YTesting=Y[testing])
  
#Objects returned

  names(Prediction)
  Prediction$Brier.Score
  Prediction$Estimated.Probabilities

  

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