we can get feature importance by 'weight' :
model.feature_importances_
But this is not what i want. I want by importances by information gain.
we can get feature importance by 'gain' plot :
xgboost.plot_importance(model, importance_type='gain')
However, I don't know how to get feature importance data from above plot. Or
if there is function like model.feature_importances_
to give gain feature importance? Either of the two ways will work. Please let me know in comments if the question is not clear
You can get it from
model.booster().get_score(importance_type='gain')
http://xgboost.readthedocs.io/en/latest/python/python_api.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With