Support lgb.cv and xgb.cv for cross-validation
Unlike the current implementation of cv in nyaggle, The models trained in lgb.cv and xgb.cv have an equal number of trees in all folds.
Since these “balanced” models may work better when the number of data is small, we sometimes want to extract the trained models from lgb.cv or xgb.cv and use them for test data.
So it would be useful to have the option to use these cv functions in nyaggle's run_experiment and cross_validate as well.
ref: https://blog.amedama.jp/entry/lightgbm-cv-model https://blog.amedama.jp/entry/xgboost-cv-model
PR がマージされたので、おそらく次のリリースから lightgbm.cv() 関数に return_cvbooster オプションが追加されて、謎のコールバックを使わなくても学習済み Booster が取得できるようになるよ。
https://twitter.com/momijiame/status/1290078465333444609
Features seem to have been merged in lightgbm v3.0.0.
[python] add return_cvbooster flag to cv func and publish _CVBooster (#283,#2105,#1445) @momijiame (#3204)
https://github.com/microsoft/LightGBM/releases/tag/v3.0.0