Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xgboost model getfscore:'str' object is not callable

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!

like image 593
Chan Avatar asked Dec 23 '22 03:12

Chan


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.

like image 194
Ruli Avatar answered Dec 28 '22 07:12

Ruli