[R] Help me! using random Forest package, how to calculate Error Rates in the training set ?

Liaw, Andy andy_liaw at merck.com
Mon Jan 11 17:46:01 CET 2010


From: bbslover
> 
> now I am learining random forest and using random forest 
> package, I can get
> the OOB error rates, and test set rate, now I want to get the 
> training set
> error rate, how can I do?
> 
> pgp.rf<-randomForest(x.tr,y.tr,x.ts,y.ts,ntree=1e3,keep.forest
> =FALSE,do.trace=1e2)    
> using the code can get oob and test set error rate, if I 
> replace x.ts and
> y.ts with x.tr and y.tr,respectively,  is the error rate in 
> the training set
> ?   
> 
> pgp.rf<-randomForest(x.tr,y.tr,x.tr,y.tr,ntree=1e3,keep.forest
> =FALSE,do.trace=1e2) 
> 
> this time, I get oob error rates and training set error rate, 
> is  right?

Yes, or if you used keep.forest=TRUE, feed predict() with your x.tr and
compare that with y.tr.

However, I really don't understand why people compute "training error
rate": what useful information can you get from it?

Andy
 
> thank you!
> -- 
> View this message in context: 
> http://n4.nabble.com/Help-me-using-random-Forest-package-how-t
> o-calculate-Error-Rates-in-the-training-set-tp1010987p1010987.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
Notice:  This e-mail message, together with any attachme...{{dropped:10}}



More information about the R-help mailing list