Feature Importance with XGBClassifier

后端 未结 9 1174
隐瞒了意图╮
隐瞒了意图╮ 2020-12-14 10:03

Hopefully I\'m reading this wrong but in the XGBoost library documentation, there is note of extracting the feature importance attributes using feature_importances_

9条回答
  •  生来不讨喜
    2020-12-14 10:57

    For those having the same problem as Luís Bianchin, "TypeError: 'str' object is not callable", I found a solution (that works for me at least) here.

    In short, I found modifying David's code from

    imp_vals = xgb.booster().get_fscore()
    

    to

    imp_vals = xgb.get_fscore()
    

    worked for me.

    For more detail I would recommend visiting the link above.

    Big thanks to David and ianozsvald

提交回复
热议问题