Evaluation indicators commonly used in regression algorithms: MAE, MSE and RMSE
1. MAE (Mean Absolute Error: mean absolute error)
Among them, represents the real value and represents the predicted value
mean_absolute_error = np.sum(np.absolute(y_true - y_predict)) / len(y_true)
2. MSE (Mean Square Error: Mean Square Error)
The sum of squares of the true value minus the predicted value divided by the predicted sample size makes it independent of the test sample size.
mean_squared_error = np.sum((y_true-y_predict)**2) / len(y_predict)
3. RMSE (Root Mean Square Error: root mean square error)
RMSE = square root of MSE mean square error
root_mean_squared_error = sqrt(mean_squared_error)
4. R Squared(R2)
R-squared, also known as the coefficient of determination, is used to determine how close the data are to the fitted regression line.
The normal value range of the "coefficient of determination" is [0, 1], the closer to 1, the stronger the explanatory ability of the variables of the equation to y, and the better the model fits the data
r_squared = 1 - mean_squared_error / np.var(y_true)
5. Diagram
6. Summary
source:
Xu Huirong. Optimization and application of fruit sugar detection model based on visible/near-infrared spectroscopy[D]. Zhejiang University, 2010.
A full summary of classification algorithm evaluation indicators:
reference:
(4 messages) Basic concepts--MAE, MSE and RMSE_mae and mse_Meng Xiaobo's Blog-CSDN Blog