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

How can I use xgboost_ray to train a model and use origin xgboost for predict? #236

Open
WZFish opened this issue Sep 20, 2022 · 3 comments

Comments

@WZFish
Copy link

WZFish commented Sep 20, 2022

Because when I train a model the dataset is very large. But when predict there are small dataset and predict more than 1000 times,But xgboost_ray is slower than origin xgboost in predict,How can I solve it

@Yard1
Copy link
Member

Yard1 commented Sep 20, 2022

The model returned by xgboost-ray is a standard xgboost model which you can use in a non-distributed fashion as well. Refer to xgboost documentation on how to do predictions with it - https://xgboost.readthedocs.io/en/stable/python/python_api.html#xgboost.Booster.predict

@WZFish
Copy link
Author

WZFish commented Sep 20, 2022

I use the sklearn API and when I use model.predict(x) it still run 4 actors(I set n_jobs=4) and very slow. How can I use standard xgboost sklearn API to predict? Thank you very much

@Yard1
Copy link
Member

Yard1 commented Sep 20, 2022

You can obtain the underlying model from the sklearn API by calling model.get_booster() to obtain an xgboost.Booster object you can use as in the link above, or use it to instantiate non-distributed XGBoost sklearn estimator.

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

2 participants