As I understand it one can use cross validation to help find the optimal pruning of a classification or regression tree, for example, implemented here in Matlab. I do not understand the following about this process. Since each cross validation fold has random data, it may be that the trees fit on each data set may be different and have differing depths. How can one find the best pruning level over all such trees then?
How is cross validation used to prune a decision tree
decision trees;cross validation