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
评论列表
文章目录