File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -122,10 +122,10 @@ def get_gbt_model_from_xgboost(booster: Any) -> Any:
122122 self .position = position
123123
124124 # Release Note for XGBoost 1.5.0: Python interface now supports configuring
125- # constraints using feature names instead of feature indices.
126- if booster.feature_names is None :
127- lst = [* range (booster.num_features())]
128- booster.feature_names = [str (i) for i in lst]
125+ # constraints using feature names instead of feature indices. This also
126+ # helps with pandas input with set feature names.
127+ lst = [* range (booster.num_features())]
128+ booster.feature_names = [str (i) for i in lst]
129129
130130 trees_arr = booster.get_dump(dump_format = " json" )
131131 xgb_config = json.loads(booster.save_config())
You can’t perform that action at this time.
0 commit comments