Skip to content

Commit dba6ce5

Browse files
minghao51skzhang1thinkall
authored
Commenting use_label_encoder - xgboost (microsoft#1122)
* Commenting use_label_encoder - xgboost * format change * moving the import xgboost version to the head * Shfit params for use_label to outside maxdept * Keep the original logic --------- Co-authored-by: Shaokun <[email protected]> Co-authored-by: Li Jiang <[email protected]>
1 parent 8361979 commit dba6ce5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

flaml/automl/model.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -1508,7 +1508,12 @@ def config2params(self, config: dict) -> dict:
15081508
params["grow_policy"] = params.get("grow_policy", "lossguide")
15091509
params["tree_method"] = params.get("tree_method", "hist")
15101510
# params["booster"] = params.get("booster", "gbtree")
1511-
params["use_label_encoder"] = params.get("use_label_encoder", False)
1511+
1512+
# use_label_encoder is deprecated in 1.7.
1513+
from xgboost import __version__ as xgboost_version
1514+
1515+
if xgboost_version < "1.7.0":
1516+
params["use_label_encoder"] = params.get("use_label_encoder", False)
15121517
if "n_jobs" in config:
15131518
params["nthread"] = params.pop("n_jobs")
15141519
return params

0 commit comments

Comments
 (0)