Description Usage Arguments Value Author(s) References See Also Examples
View source: R/Predict.OTClass.R
This function provides prediction for test data on the trained OTClass
object for classification.
1 | Predict.OTClass(Opt.Trees, XTesting, YTesting)
|
Opt.Trees |
An object of class |
XTesting |
An |
YTesting |
Optional. A vector of length |
A list with values
Error.Rate |
Error rate of the clssifier for the observations in XTesting. |
Confusion.Matrix |
Confusion matrix based on the estimated class labels and the true class labels. |
Estimated.Class |
A vector of length |
Zardad Khan <zkhan@essex.ac.uk>
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.
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.