feature = df_X.columns
importances = rf_reg.feature_importances_
index = np.argsort(importances)[::-1]
feature[index]
plt.figure(figsize = (14, 8), dpi = 50)
plt.bar(feature[index], importances[index], color="g", align="center")
plt.tick_params(labelsize=20)
参数排序,设置居中显示?
特征重要性排序并可视化
对随机森林模型的特征重要度排序,并绘制柱状图可视化