xgboost model getfscore:'str' object is not callable

Viewed 2536
feat_imp = pd.Series(xgbPara.booster().get_fscore()).sort_values(ascending=False) 

TypeError: 'str' object is not callable

I can run it in pycharm, but when I run it in pyspark, there is a Type Error.

could anyone tell me why? Thanks!

1 Answers

Replace xgbPara.booster() with xgbPara.get_booster(), if that wont work, you have a version mismatch and you need to upgrade either sklearn, xgboost or both. Hope this helps.

Related