data(iris)
TrainData <- iris[,1:4]
TrainClasses <- iris[,5]
library(e1071)
rpartFit <- train(TrainData, TrainClasses, "rpart",
tuneLength=15)
plot(rpartFit, scales = list(x = list(rot = 90)))
library(klaR)
rdaFit <- train(TrainData, TrainClasses, "rda",
control = trainControl(method = "cv"))
plot(rdaFit, plotType = "line", auto.key = TRUE)
Run the code above in your browser using DataLab