I have built a decision tree using the ctree
function via party
package. it has 1700 nodes.
Firstly, is there a way in ctree
to give the maxdepth
argument? I tried control_ctree
option but, it threw some error message saying couldnt find ctree function.
Also, how can I consume the output of this tree?. How can it be implemented for other platforms like SAS or SQL. I also have another doubt as to what does the value "* weights = 4349 "
at the end of the node signify. How will I know, that which terminal node votes for which predicted value.
There is a
maxdepth
option in ctree. It is located inctree_control()
You can use it as follows
You can also restrict the split sizes and the bucket sizes to be "no less than"
You can also to reduce increase sensetivity and lower the P-value
The
weights = 4349
you've mentioned is just the number of observations in that specific node.ctree
has a default of giving a weight of 1 to every observation, but if you feel that you have observations that deserve bigger weights you can add a weights vector to thectree()
which have to be the same length as the data set and have to be non-negative integers. After you do that, theweights = 4349
will have to be interpreted with caution.One way of using
weights
is to see which observations fell in a certain node. Using the data in the example above we can perform the followingso we can check what fell in node number 5 for example
Using this method you can create data sets that will contain the informationn of you terminal nodes and then import them into SAS or SQL
You can also get the list of splitting conditions using the function from my answer below ctree() - How to get the list of splitting conditions for each terminal node?