Skip to content
Prev 22904 / 398502 Next

why delete.response?

On Fri, 23 Aug 2002, Saket Joshi wrote:

            
In order to ignore the response.

If you remove the call to delete.response() you will not be able to
predict on a new data set that does not have the response variable
defined. Eg, following example(predict.tree)
     data(shuttle, package="MASS")
     shuttle.tr <- tree(use ~ ., shuttle, subset=1:253,
                        mindev=1e-6, minsize=2)
     shuttle.tr
     shuttle1 <- shuttle[254:256, ]  # 3 missing cases
     predict(shuttle.tr, shuttle1)

     shuttle2<-shutlle1[,-7]  #drop response variable
     ## this doesn't work in your version
     predict(shuttle.tr, shuttle2)


It's very surprising that delete.response is that slow. I haven't seen it
take more than a few hundredths of a second

	-thomas

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