-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Add Possibility to Load XGBoost Models as PySpark Models #11449
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
base: master
Are you sure you want to change the base?
Conversation
39d1379
to
a3acff2
Compare
a3acff2
to
1688ddb
Compare
raise NotImplementedError() | ||
|
||
@classmethod | ||
def convert_sklearn_model_to_spark_xgb_model( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will this function be exposed to users?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is good to expose it to users so that if they have already loaded or trained an sklearn model, and maybe want to make predictions on a large dataset they can do it without the need to save the model to disk and then load it back with the load_model
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on this. But what's the difference between the approach taken here and the following snippet?
from xgboost.spark import SparkXGBRegressorModel
from xgboost import XGBRegressor
reg = XGBRegressor()
SparkXGBRegressorModel(reg, None)
Hello @trivialfis , |
LGTM. |
Closes #11400
The default values for
device
,use_gpu
andtree_method
were added due to this function call, and eventually this one which assumes they already exist in_paramMap
or_defaultParamMap
.