回归预测评估指标
标注说明
ff表示预测值,yy表示实际值
评价指标
- MAE(Mean Absolute Error) 平均绝对误差
- MSE(Mean Square Error) 平均平方差/均方误差是回归任务最常用的性能度量。
-
RMSE(Root Mean Square Error) 方均根差
缺点:因为它使用的是平均误差,而平均误差对异常点较敏感,如果回归器对某个点的回归值很不合理,那么它的误差则比较大,从而会对RMSE的值有较大影响,即平均值是非鲁棒的。 -
MAPE
全称是Mean Absolute Percentage Error(WikiPedia), 也叫mean absolute percentage deviation (MAPD),在统计领域是一个预测准确性的衡量指标。 -
R平方
y¯表示观测数据的平均值
残差平方和
总平均值
R平方
R平方是多元回归中的回归平方和占总平方和的比例,它是度量多元回归方程中拟合程度的一个统计量,反映了在因变量yy的变差中被估计的回归方程所解释的比例。
R平方越接近1,表明回归平方和占总平方和的比例越大,回归线与各观测点越接近,用xx的变化来解释yy值变差的部分就越多,回归的拟合程度就越好。 -
校正R平方
http://www.statisticshowto.com/adjusted-r2/where: N is the number of points in your data sample.
K is the number of independent regressors, i.e. the number of variables in your model, excluding the constant -
RMSPE
where yiyi denotes the sales of a single store on a single day and y^iy^i denotes the corresponding prediction.
https://www.kaggle.com/cast42/xgboost-in-python-with-rmspe-v2/code
- RMSLE(Root Mean Squared Logarithmic Error) Kaggle 上用的一个指标https://www.kaggle.com/wiki/RootMeanSquaredLogarithmicError
def rmsle(predicted,real):
sum=0.0
for x in range(len(predicted)):
p = np.log(predicted[x]+1)
r = np.log(real[x]+1)
sum = sum + (p - r)**2
return (sum/len(predicted))**0.5
# https://www.kaggle.com/jpopham91/rmlse-vectorized
# vectorized error calc
def rmsle(y, y0):
assert len(y) == len(y0)
return np.sqrt(np.mean(np.power(np.log1p(y)-np.log1p(y0), 2)))
转载自:https://blog.csdn.net/u013704227/article/details/77604500/