# Explanatory power of a Decision Tree

With Multiple Regression, the R-Squared gives the researcher an estimate of the explanatory power of the regression equation.

What is the equivalent for Decision Trees?

Decision tree usually "overfit" the data (in the sense that every point is assigned to a specific class) if you don't provide them early stopping criterion when you grow the tree. However, you can use out-of-bags estimate to get a pseudo R squared.

Per example, for a regression random forest, R offers an implementation of the pseudo R squared.

Value
An object of class randomForest, which is a list with the following components:
[...]
rsq (regression only) “pseudo R-squared”: 1 - mse / Var(y)

• Let's say I'm trying to find the best tree... so I'm trying different stopping criteria and evaluating the resulting trees... how would I compare these various trees to select the best one? What's the standard heuristic used in research papers? – thanks_in_advance Sep 11 '15 at 23:13

The measure of model accuracy I see most is the "confusion matrix". It's a table that shows which observations were fitted correctly and which were misclassified. Here's an example with R code. From a table of Actual vs. Predicted, you could calculate many measures like

1. What percentage of observations did my model predict correctly?
2. What percentage is my type I/II error?
3. etc.

In general, however, R-sq can be calculated for most models - you can square the correlation of the observed values with the fitted values from a (tree) model. I haven't seen R-sq used with decision trees, but I've calculated it in the past for superiors who really like seeing R-sq values for any and all modeling analyses.