-
Notifications
You must be signed in to change notification settings - Fork 508
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
Commenting use_label_encoder - xgboost #1122
Commenting use_label_encoder - xgboost #1122
Conversation
@qingyun-wu Check benchmark option. |
@minghao51, thank you for the contribution. We have some installation option that requires xgboost version earlier than 1.7.0. Can you please first check the version of xgboost and only comment the line only when the version number is larger than or equal to 1.7.0? This ensure the code still works fine even when an earlier version of xgboost is used. Thank you! |
Sure |
Updated the PR |
flaml/automl/model.py
Outdated
params["use_label_encoder"] = params.get("use_label_encoder", False) | ||
# params["booster"] = params.get("booster", "gbtree") | ||
# use_label_encoder is deprecated in 1.7.0 | ||
from xgboost import __version__ as xgboost_version |
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.
This code block should not be under the max_depth == 0
condition.
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.
should the import xgboost version be under the function then? or at the very start?
flaml/automl/model.py
Outdated
if xgboost_version < "1.7.0": | ||
params["use_label_encoder"] = params.get("use_label_encoder", False) |
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.
Sorry about the confusion. I mean all these several lines of code.
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.
They need to be outside of the condition if max_depth == 0:
according to the original logic.
Why are these changes needed?
use_label_encoder
is deprecated since 1.7.0. (xgboost), yet it is still currently provided as part of the hyperparameter for xgboostRelated issue number
#1120
Checks