def corrPlotV(dv_true,dv_pred,sv_true,sv_pred,teamName,outName):
slope, intercept, rvalue, pvalue, std_err = stats.linregress(np.append(dv_true,sv_true),np.append(dv_pred,sv_pred))
plt.scatter(dv_true,dv_pred,label='Diastolic Volume',marker='o',facecolors='none',edgecolors='r')
plt.scatter(sv_true,sv_pred,label='Systolic Volume',marker='o',facecolors='none',edgecolors='b')
plt.xlabel("True Volume (mL)")
plt.ylabel("Predicted Volume (mL)")
plt.title("%s\nCorrelation of Volume Predictions with Test Values" % teamName)
x = np.linspace(0,500,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,500))
plt.gca().set_ylim((0,500))
plt.legend(loc='upper left')
plt.grid()
plt.savefig("%sCorrVols.png" % outName)
plt.close()
#plotting prediction vs truth... EF
评论列表
文章目录