Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support lgb.cv and xgb.cv for cross-validation #75

Open
nyanp opened this issue Jun 14, 2020 · 2 comments
Open

Support lgb.cv and xgb.cv for cross-validation #75

nyanp opened this issue Jun 14, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@nyanp
Copy link
Owner

nyanp commented Jun 14, 2020

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

@nyanp nyanp added the enhancement New feature or request label Jun 14, 2020
@wakame1367
Copy link
Collaborator

wakame1367 commented Aug 3, 2020

PR がマージされたので、おそらく次のリリースから lightgbm.cv() 関数に return_cvbooster オプションが追加されて、謎のコールバックを使わなくても学習済み Booster が取得できるようになるよ。

https://twitter.com/momijiame/status/1290078465333444609

@wakame1367
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants