question
On Fri, 2 Aug 2002, Saket Joshi wrote:
Hi all, I am running R1.5.0 on Unix. I fitted a tree model my.tree on some data my.data and the tree has only 2 leaves. Now I have some test data new.data When I run predict(my.tree, new.data) it does give a reasonable answer but it takes 60 to 90 seconds to come up with the answer. I had expected it to take far less than that considering that the predict function has just to traverse a tree with 2 nodes and give the answer. Could anyone tell me why this function is taking so much time to run?
Not on the amount of information you have given. Take a look at `Writing R Extensions' or an earlier Programmers' Niche in R-news for how to profile your run to see where the time is being spent.
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 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._