Hi,
I posted this question before, but didn't get a satifatory answer (maybe
the question wasn't stated clearly).
I am trying to build a tree model using rpart. I need a way to get the
tree with any given number of splits. Checking the cp table (using
printcp) can't help in many cases. For example, given the following CP
table,
CP nsplit rel error xerror xstd
1 0.050633 0 1.00000 1.0000 0.036718
2 0.035443 1 0.94937 1.0734 0.036796
3 0.022785 3 0.87848 1.0810 0.036794
4 0.020253 7 0.78228 1.0633 0.036795
I can't get a tree with 2 splits.
Does anyone have a solution? espeically a method that can accomplish this
goal automatically.
Thanks,
Kai Yu
|