问题
Is rpart automatic pruning?
The decision tree produced by rpart is much more levels than that produced by Oracle Data Mining which has the automatic pruning.
回答1:
No, but the defaults for the fitting function may stop splitting "early" (for some definition of "early").
See ?rpart.control
for the parameters you can tweak. In particular, see the argument minsplit
and minbucket
in that help file. These are stopping rules that will prevent any node being split if those conditions are not met.
You will most likely need to prune the tree back using prune()
to some optimal value of the cost-complexity parameter.
来源:https://stackoverflow.com/questions/13136683/is-rpart-automatic-pruning