When plotting a ctree
model from partykit, I understand that it choose a default to prevent overfitting with overgrown trees. This default value sometimes results in an overly simple tree. To use a post-pruning technique I want to make an overfitting tree, potentially full-grown, using ctree and then work on the pruning later. Try many different things but my code is getting an error.
This stack overflow answer on using all variables to make the tree is not what I want. I don't necessarily want all variables, but I want maximum depth for a tree to go as overgrown as possible.
Basically, how to have the tree go as many depths as possible?
See code and output below:
treemodel <- ctree(Species ~ ., iris)
plot(treemodel)
And I use the Help + documentation from the package but don't see a lot of options to customize this. Promising one is the control parameter, but the documentation isn't very detailed. From searching on other forums, I gave the following a try:
treemodel <- ctree(Species ~ ., iris, control=mincriterion)
I also tried:
treemodel <- ctree(Species ~ ., iris, control="mincriterion")
But both code throws an error. The error:
Error in if (sum(weights) < ctrl$minsplit) return(partynode(as.integer(id))) : argument is of length zero
I am using partykit 1.1-1 and r on mac os.