I use the rpart package to classify the decision tree. I have a data frame with about 4000 functions (columns). I want to use all the functions in rpart()for my model. How can i do this? Basically, rpart()ask me to use the function this way:
rpart()
dt <- rpart(class ~ feature1 + feature2 + ....)
My functions are words in documents, so I have more than 4 thousand functions. Each function is represented by a word. Is it possible to use all functions without writing them?
I understood:
dt <- rpart(class ~ ., data)
"" represents all functions.
caret , . rpart, .
caret
rpart
library(caret) library(data.table) mt <- data.table(mtcars) tr <- train(x=mt[,-'hp', with=FALSE], y = mt[, hp], method='rpart') plot(tr$finalModel) text(tr$finalModel)
4000 , . caret -. model='rf' .
model='rf'