1
$\begingroup$

I trained models based on the same dataset, using random forest (sklearn) and CatBoost.

I use n_estimators=1000 for random forest, and n_estimators(iterations)=1000 for CatBoost. The random forest has significantly larger model size compared to that of CatBoost.

They both have a lot of trees in the model. Why the size difference is so large?

$\endgroup$

1 Answer 1

1
$\begingroup$

Without seeing your code is hard to answer. That said, base-learners in a random forest (i.e. the trees) usually are not confined to a small tree depth. The most common setting is to confine the tree depth by the minimum number of samples per tree or just prune the tree based on impurity decreases (e.g. like the RPART doc suggests). On the contrary, gradient boosting machine methodologies usually, actively discourage very deep trees to avoid over-fitting (e.g. Catboost doc suggest that the optimal depth range are from 4 to 10). As such, we might have the same number of trees/base-learner in both methods but the random forest will probably have "chunkier" base-learners leading to an overall larger model size.

$\endgroup$
2
  • $\begingroup$ Could you explain "impurity" a little bit more? For the depth of CatBoost, if it is too large, maybe it cannot converge? $\endgroup$
    – I Wonder
    Commented Jun 20, 2019 at 6:10
  • $\begingroup$ By node impurity I refer at how heterogenous a particular node (leaf) is. Common metrics include the misclassification error, Gini Index and Cross-Entropy. Hastie et al. ESL Chapt. 9.2 on Tree-Based Methods visits this in more detail. Regarding GBM's depth: Usually "convergence" is not the issue, we might converge to a "good solution" that could be a local maximum and as such we have issues with over-fitting and lack of generalisation. $\endgroup$
    – usεr11852
    Commented Jun 20, 2019 at 18:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.