評價指標(純手寫)

RubyTsui發表於2024-07-29

MSE

MSE = np.sum((y_preditc-y_test)**2)/len(y_test)

RMSE

RMSE = MSE ** 0.5

MAE

MAE = np.sum(np.absolute(y_preditc-y_test))/len(y_test)

R2

SS_res = np.sum((y - y_pred) ** 2)
SS_tot = np.sum((y - np.mean(y)) ** 2)
R2 = 1 - SS_res / SS_tot

相關文章