[R] timing predict.tree()

Saket Joshi joshi at engr.orst.edu
Tue Aug 6 06:05:14 CEST 2002


Hi all,

I am running R1.5.0 under Unix.
I am repeating my earlier question with a few details added.

I have the following tree fitted as the tree object 'my.tree':

node), split, n, deviance, yval
      * denotes terminal node

1) root 5807 0.9998 0.0001722
  2) V604 < 0.5 5798 0.0000 0.0000000 *
  3) V604 > 0.5 9 0.8889 0.1111000 *


And I have a data.frame called 'new.temp' for which I want to make
predictions with this tree. new.temp is a data.frame with a single row and
the required number of columns.

When I run:
predict.tree(my.tree, new.temp)

it takes 60 to 70 seconds to get the output. I had expected it to take far
less because the tree is very small and the new data contains just 1 row.

My question is: Does this function 'predict.tree' provided in the library
package 'tree' really consume so much time even for minor calculations or
is something wrong?

Thanks in advance,
-Saket.



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