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

[feature ] return the best model after early stop #10816

Open
sonetto19999 opened this issue Sep 10, 2024 · 3 comments
Open

[feature ] return the best model after early stop #10816

sonetto19999 opened this issue Sep 10, 2024 · 3 comments

Comments

@sonetto19999
Copy link

sonetto19999 commented Sep 10, 2024

Does xgboost4j-spark support to get the best model after early stop?

It seems it will get the model at that iteration which is best iteration + num_early_stopping_rounds, am i wrong?
how could i get the best model?
image

@wbo4958
Copy link
Contributor

wbo4958 commented Sep 11, 2024

I guess when predicting, you can specify how many trees to be used. But currently, xgboost4j has not supported specifying the tree limit. I will make a PR for it.

@trivialfis
Copy link
Member

Jvm doesn't support model slicing yet. @wbo4958 this might help

def model_slices() -> None:
.

@wbo4958
Copy link
Contributor

wbo4958 commented Sep 13, 2024

Cool, looks like it's doable.

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

No branches or pull requests

3 participants