I am working in a project which requires to use Rpart
package in R to build a decision tree.
However, my direct report manager is interested in a specific variables to start as the root node in the tree as he value that specific variable as significant in our business.
May I know anyone has the knowledge in how to force the tree to start with that specific variable? for instance, that variable name is X.
Description of the dataset: target variable Y. with 30 other independent variables.
Code:
tree <- rpart(Y~., method="class", data=train, parms=list(split="information"), control=rpart.control(cp=.0002,minsplit = 5,minbucket = 5,maxdepth = 10))