Solved – Difference between rel error and xerror in rpart regression trees

cartrpart

Wondering what the difference is between rel error (relative error) and xerror (apparent error) in regression trees?

I am using the rpart package and the output returns these metrics cross-validated over the number of splits.

Anyone know the difference between these two quantities or perhaps even the formulas?

Best Answer

The "rel error" is $1 - R^2$ Root mean squared error, similar to linear regression. This is the error on the observations used to estimate the model.

The "xerror" is related to the PRESS statistic. This is the error on the observations from cross validation data.