plots.py 文件源码

python
阅读 39 收藏 0 点赞 0 评论 0

项目:dsbAnalysis 作者: jonrmulholland 项目源码 文件源码
def corrPlotEF(true,pred,teamName,outName):  
    slope, intercept, rvalue, pvalue, std_err = stats.linregress(true*100.0,pred*100.0)
    plt.scatter(true*100.0,pred*100.0,marker='x',color='#990099',label="Ejection Fraction")
    x = np.linspace(0,90,10)
    plt.plot(x,x,color='k',label='guide y = x')
    plt.plot(x,x*slope+intercept,color = 'k',linestyle='--',label='y=%.2fx+%.2f\n$R^2=$%.3f p=%.2e' % (slope,intercept,rvalue**2,pvalue))
    plt.gca().set_xlim((0,90))
    plt.gca().set_ylim((0,90))
    plt.xlabel("True Ejection Fraction (%)")
    plt.ylabel("Predicted Ejection Fraction (%)")
    plt.title("%s\nCorrelation of EF Predictions with Test Values" % teamName)
    plt.legend(loc='upper left')
    plt.grid()
    plt.savefig("%sCorrEF.png" % outName)
    plt.close()

##################
#
#  Bland - Altman plots
#
#plotting Bland-Altman for dv and sv
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号