随进森林和xgb特征重要性和特征名称对应输出

# XX为df格式 train特征表
feature_names = XX.columns.tolist()
feature_names = np.array(feature_names)
feature_importances = clf.feature_importances_
indices = np.argsort(feature_importances)[::-1]
x = feature_importances[show_indices]
y=feature_names[indices]

©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页