How to use all functions in rpart?

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:

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?

+4
source share
2 answers

I understood:

dt <- rpart(class ~ ., data)

"" represents all functions.

+4
source

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' .

+1

All Articles