首页 > 其他分享 >机器学习评价指标之回归问题

机器学习评价指标之回归问题

时间:2023-02-21 18:35:16浏览次数:60  
标签:机器 R2 predict 回归 squared error test 评价 mean

1. 平均绝对误差:MAE(Mean Absolute Error)

2. 均方误差:MSE(Mean Squared Error)

3. 均方根误差:RMSE(Root Mean Squard Error)

4. 决定系数:R2(R-Square)

5. 校正决定系数(Adjusted R-Square)

from sklearn.metrics import mean_squared_error #均方误差
from sklearn.metrics import mean_absolute_error #平方绝对误差
from sklearn.metrics import r2_score#R square
#调用
# MAE:
mean_absolute_error(y_test,y_predict)
# MSE:
mean_squared_error(y_test,y_predict)
# RMSE:
np.sqrt(mean_squared_error(y_test,y_predict))
# R2:
r2_score(y_test,y_predict)
# Adjusted_R2:
1-((1-r2_score(y_test,y_predict))*(n-1))/(n-p-1)

参考:回归评价指标:MSE、RMSE、MAE、R2、Adjusted R2

标签:机器,R2,predict,回归,squared,error,test,评价,mean
From: https://www.cnblogs.com/odesey/p/17142001.html

相关文章