microsoft / LightGBM

A fast, distributed, high performance gradient boosting (GBT, GBDT, GBRT, GBM or MART) framework based on decision tree algorithms, used for ranking, classification and many other machine learning tasks.
https://lightgbm.readthedocs.io/en/latest/
MIT License
16.57k stars 3.82k forks source link

boosting_type "rf" leads to unresolvable failures #1333

Closed namato closed 6 years ago

namato commented 6 years ago

Hey guys, I'm doing some grid searching with various boosting_type settings, and notice that whenever I use boosting_type rf, the fit fails:

[LightGBM] [Fatal] Check failed: config->bagging_freq > 0 && config->bagging_fraction < 1.0f && config-
>bagging_fraction > 0.0f at /home/travis/build/Microsoft/LightGBM/python-package/compile/src/boosting/r
f.hpp, line 29 .

Even though in the sklearn API: 1) There are no other parameters set other than the defaults 2) The fit succeeds with "gbd", "dart" and "goss" 3) There is no way to actually set these values in the sklearn API (bagging_freq, bagging_fraction) other than through additional kwargs, which is apparently unsupported

guolinke commented 6 years ago

for random forest, you should use subsets (that is the definition of RF). As a result, you should set baggeng_freq=1 with bagging_fraction < 1.0f