bethatkinson / rpart

Recursive Partitioning and Regression Trees
50 stars 26 forks source link

How to calculate the "xerror" in cptable of rpart fit #44

Open gsnrguo opened 2 years ago

gsnrguo commented 2 years ago

The 'xerror' is related to the PRESS statistic [https://cran.r-project.org/web/packages/rpart/vignettes/longintro.pdf](p 34).

 Examples of **_xpred.rpart_**

The PRESS is achivied by apply(xerr, 2, sum) . It is obvious that PRESS of fit is not equal to 'xerror', what is the formula of 'xerror' in rpart? Thanks!