0

Would it make sense to apply bagging of random forests? For example:

brf = BaggingRegressor(base_estimator=RandomForestModel,
                        n_estimators=10,
                        max_samples=1.0,
                        bootstrap=True, # Samples are drawn with replacement
                        n_jobs= n_jobs,
                        random_state=random_state).fit(X_train, Y_train)

Or to have, on a stacking model, a Random Forest as the base/final estimator?

desertnaut
  • 57,590
  • 26
  • 140
  • 166
  • 1
    Please see (own) answers in https://stackoverflow.com/questions/57968476/execution-time-of-adaboost-with-svm-base-classifier/57982983#57982983 and https://stackoverflow.com/questions/66977025/using-random-forest-as-base-classifier-with-adaboost/66985202#66985202 (they are about boosting, not bagging, but the rationale is the same). – desertnaut Nov 10 '21 at 22:17
  • 1
    In my opinion, it's all about improving the performance. So, as long as your performance is improving any kind of weird/unusual model architecture would makes sense (: – Keivan Ipchi Hagh Nov 10 '21 at 22:22
  • 1
    @KeivanIpchiHagh although in principle you are not wrong, both bagging and boosting are based on some theoretical principles, and they are not anything-goes, as a superficial engagement with them only through high-level code-only tutorials may seem to suggest. And the fact that you *can* mix them in scikit-learn does not mean that you *should* do it – desertnaut Nov 10 '21 at 22:25
  • 1
    @desertnaut you are totally right, one must know the principles and use them accordingly in order to achieve higher performance. I'm just keeping room for creativity (: – Keivan Ipchi Hagh Nov 10 '21 at 22:50

0 Answers0