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

Chan
  • 41
  • 1
  • 4

1 Answers1

11

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.

Ruli
  • 2,592
  • 12
  • 30
  • 40