# 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 object from the training data:
breast.fft <- FFTrees(
formula = diagnosis ~ .,
data = breast.train
)
# Predict classification outcomes for test data:
breast.fft.pred <- predict(breast.fft,
newdata = breast.test
)
# Predict class probabilities for test data:
breast.fft.pred <- predict(breast.fft,
newdata = breast.test,
type = "prob"
)
Run the code above in your browser using DataLab