[R] rpart: apply tree to new data to get "counts"

Jay josip.2000 at gmail.com
Mon Aug 29 21:25:59 CEST 2011


I tried that, while I find the documentation a bit short, but the only
result I get from this is a probability distribution of my data (I'm
building a tree with 2 classes). How do I plot a tree where the counts
are show in each step/node?

BR,
Jay

On Aug 29, 9:40 pm, Weidong Gu <anopheles... at gmail.com> wrote:
> ? predict.rpart
>
> Weidong Gu
>
>
>
> On Mon, Aug 29, 2011 at 12:49 PM, Jay <josip.2... at gmail.com> wrote:
> > Hi,
>
> > when I have made a decision tree with rpart, is it possible to "apply"
> > this tree to a new set of data in order to find out the distribution
> > of observations? Ideally I would like to plot my original tree, with
> > the counts (at each node) of the new data.
>
> > Reagards,
> > Jay
>
> > ______________________________________________
> > R-h... at r-project.org mailing list
> >https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
> ______________________________________________
> R-h... at r-project.org mailing listhttps://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list