[R] Regression Trees

Vladimir N. Kutinsky kutinskyv at obninsk.com
Wed Jan 16 23:53:53 CET 2002


Hi, all.

I'm trying to implement an interface between R and A+ programming
language (www.aplusdev.org). In A+ I create a scipt file which I pass to
R (R CMD BATCH file), the results are written into a file and then I
read them back in A+ where I can continue my work with my data.  Now, I
work with Regression tress and this is the problem:

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?

By the way, does anybody have any suggestions of how to make the
interface another way, other than through script files?
Can R functions be called directly from within C scripts (like
tr=tree(data,formula)). I see that the function "tree" calls a C
function "BDRgrow1" and that would be just fine if it wasn't for some
additional R code contained in the "tree" function.

Thank you

Vladimir



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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