机器学习中的一些COST函数的说明

本文详细介绍了机器学习中用于Regression问题的RMSLE(Root Mean Squared Logarithmic Error)、RMSE(Root Mean Squared Error)和MAE(Mean Absolute Error)三个Cost函数。RMSLE关注比例差异,对低估惩罚更重;RMSE关注绝对值,适用于抑制大误差;MAE则仅关注偏移误差。此外,还简要提到了Classification问题中的Confusion Matrix及其相关评估指标。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一般这些函数都能在 sklearn.metrics 中找到

Regression问题

以下Cost主要针对Regression问题

RMSLE (Root Mean Squared Logarithmic Error )

sklearn.metrics.mean_squared_log_error,没有root,问题不大。
标准公式如下:
1ni=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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值