xgboost 特徵重要性選擇 / 看所有特徵哪個重要

guotong1988發表於2018-06-06
xgb_trained_model = xgb.train(params, train_xgb_split, 500, watch_list, early_stopping_rounds=50, verbose_eval=10)

importance = xgb_trained_model.get_fscore()
temp1 = []
temp2 = []
for k in importance:
    temp1.append(k)
    temp2.append(importance[k])
print(pd.DataFrame({
        'column': temp1,
        'importance': temp2,
    }).sort_values(by='importance'))

相關文章