[R] Regression Trees

white.denis@epamail.epa.gov white.denis at epamail.epa.gov
Wed Jan 16 22:00:53 CET 2002


> when I print the tree I get something like this:
>     1)  root 1130 19580.00 535.6
>       2) V17: 2,3,4,5 853 4833.00 533.7
>         4)V9 < 541.5 185 1011.00 531.9 *
>     ................................etc
>
> When I use this tree for prediction :
>
>      >predict.tree(t, data[1,])
>
> I get something like this:
>
>      >531.9205  //note the precision!!!
>
> though, according to the tree table above(suppose that the new point
> gets to the 4th node) I should have got 531.9!
> It looks like the function print.tree(t) rounds the predicted values.
If
> it is so, the question is if there is a way to make print.tree print
the
> predicted values as they are, without rounding them.
> Is the problem in anything else?

See parameter "digits" in print.tree.

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list