Skip to content

Commit

Permalink
fix: fix rmse,use rmse/mean(y) *100%
Browse files Browse the repository at this point in the history
  • Loading branch information
archeno committed Aug 28, 2024
1 parent 7ab75cc commit 63afde3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fy_polyfit/polyfit.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def main():

#绘制原始数据点和一次拟合曲线
ax[0].scatter(x, y, label='source points')
ax[0].plot(x_fit, y_fit1, color='red',label=f" Linear Fitted Curve, rmse = {rmse1 *100:.2f}%")
ax[0].plot(x_fit, y_fit1, color='red',label=f" Linear Fitted Curve, rmse = {(rmse1 *100)/np.mean(y):.2f}%")
ax[0].set_title('Linear Curve Fitting')
ax[0].set_xlabel('x')
ax[0].set_ylabel('y')
Expand All @@ -98,7 +98,7 @@ def main():

#绘制原始数据点和二次拟和曲线
ax[1].scatter(x, y, label='source points')
ax[1].plot(x_fit, y_fit2, color='blue',label=f" Quadratic Fitted Curve, rmse = {rmse2 * 100:.2f}%")
ax[1].plot(x_fit, y_fit2, color='blue',label=f" Quadratic Fitted Curve, rmse = {(rmse2 * 100)/np.mean(y):.2f}%")
ax[1].set_title('Quadratic Curve Fitting')
ax[1].set_xlabel('x')
ax[1].set_ylabel('y')
Expand Down

0 comments on commit 63afde3

Please sign in to comment.