对python中的多元线性回归的结果画森林图:

plt.figure()
plt.errorbar(y=range(len(res_sum)), x=res_sum['coef'], xerr=res_sum['[0.025']-res_sum['0.975]'],fmt='o', 
             capsize=3, markersize=7, mfc="red", mec="red")
plt.yticks(range(len(res_sum)), res_sum.indicator.tolist())

plt.xlabel('coef (±95% CI)')
plt.show()

结果如图:

 

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐