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

Using best round when applying early stopping #26

Closed
ChristianMichelsen opened this issue Mar 22, 2021 · 2 comments · Fixed by #27
Closed

Using best round when applying early stopping #26

ChristianMichelsen opened this issue Mar 22, 2021 · 2 comments · Fixed by #27
Assignees
Labels
bug Something isn't working

Comments

@ChristianMichelsen
Copy link

Hi and thanks for a really interesting library!

I have two small questions.

First of all I was thinking about the reasoning behind your choice of XGBoost instead of LightGBM? I am just curious if XGB has any inherent advantages for survival analysis compared to LGB.

Then on to my main question related to early stopping. As far as I can see, when using early stopping, you are not using the best iteration for predictions, but rather the last iteration. Or, in code; instead of:

y_pred = bst.predict(dtrain)

it should be:

y_pred = bst.predict(dtrain, ntree_limit=bst.best_ntree_limit)

Please correct me if I am mistaken since I have not used your library extensively yet :)

Cheers,

@ChristianMichelsen ChristianMichelsen added the bug Something isn't working label Mar 22, 2021
@GabrielGimenez
Copy link
Contributor

GabrielGimenez commented Mar 22, 2021

Hi Christian, thanks for your report! It's indeed a bug, we'll look into it and provide a fix soon.

About the reasoning behind XGBoost, even though LightGBM has the advantage of using categorical features directly we went for XGBoost because it has better support for survival problems via survival:cox and survival:aft objetive functions.

@ChristianMichelsen
Copy link
Author

Wow, really quick reply, nice! Cool, glad to see that it wasn't just me who couldn't find it and that it'll be fixed soon.

Ah, that makes sense. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants