prune in rpart: choose number terminal nodes
On 23/09/2012 17:32, Uwe Ligges wrote:
On 21.09.2012 11:49, agent dunham wrote:
Dear community, I've an rpart object, and I know the CP I want. I'd like to know if it's possible also to fix the number of terminal nodes I want.
I don't know of any existing function, but you can write it yourself: All the information you need is available from the rpart object.
Up to a point. The pruning sequence does not include all possible numbers of 'terminal notes' (aka 'leaves').
Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595