Predict new data from an FFTrees x
# S3 method for FFTrees
predict(object = NULL, newdata = NULL, data = NULL,
tree = 1, type = "class", sens.w = NULL, method = "laplace", ...)
An FFTrees object created from the FFTrees() function.
dataframe. A dataframe of test data
integer. Which tree in the object should be used?
string. What should be predicted? Can be "class"
, which returns a vector of class predictions, or "prob"
which returns a matrix of class probabilities.
depricated
string. Method of calculating class probabilities. Either 'laplace', which applies the Laplace correction, or 'raw' which applies no correction.
Additional arguments passed on to predict()
A logical vector of predictions
# NOT RUN {
# Create training and test data
set.seed(100)
breastcancer <- breastcancer[sample(nrow(breastcancer)),]
breast.train <- breastcancer[1:150,]
breast.test <- breastcancer[151:303,]
# Create an FFTrees x from the training data
breast.fft <- FFTrees(formula = diagnosis ~.,
data = breast.train)
# Predict results for test data
breast.fft.pred <- predict(breast.fft,
data = breast.test)
# }
Run the code above in your browser using DataLab