一般这些函数都能在 sklearn.metrics 中找到
Regression问题
以下Cost主要针对Regression问题
RMSLE (Root Mean Squared Logarithmic Error )
sklearn.metrics.mean_squared_log_error,没有root,问题不大。
标准公式如下:
1n∑i=1n((log(pi+1)−log(ai+1))2‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾⎷
pi 是prediction,对应着RMSE的 yi , ai 是actual,对应着RMSE的 ŷ i
RMSLE measures the ratio between actual and predicted. 可以写成 logpi+1ai+1
It can be used when you don’t want to penalize huge differences when both the values are huge numbers.
Also, this can be used when you want to penalize under estimates more than over estimates.
就是说,它关注的是比例而不是绝对值(Only the percentual differences matter! ),同时,如果预测值比实际值低时,它的惩罚更高。
RMSE (Root Mean Squared Error)
公式如下:
1n