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

Commenting use_label_encoder - xgboost #1122

Merged
merged 8 commits into from
Aug 1, 2023

Conversation

minghao51
Copy link
Contributor

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 xgboost

Related issue number

#1120

Checks

@qingyun-wu
Copy link
Contributor

@qingyun-wu Check benchmark option.

@qingyun-wu qingyun-wu self-requested a review July 18, 2023 03:04
@qingyun-wu
Copy link
Contributor

@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!

@minghao51
Copy link
Contributor Author

Sure

@minghao51
Copy link
Contributor Author

Updated the PR

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
Copy link
Contributor

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.

Copy link
Contributor Author

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?

Comment on lines 1516 to 1517
if xgboost_version < "1.7.0":
params["use_label_encoder"] = params.get("use_label_encoder", False)
Copy link
Contributor

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.

Copy link
Contributor

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.

flaml/automl/model.py Outdated Show resolved Hide resolved
@sonichi sonichi added this pull request to the merge queue Jul 26, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 27, 2023
@thinkall thinkall added this pull request to the merge queue Aug 1, 2023
Merged via the queue into microsoft:main with commit da92238 Aug 1, 2023
13 checks passed
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

Successfully merging this pull request may close these issues.

4 participants