机器学习常用的几种损失函数,包括均方差损失 Mean Squared Loss、平均绝对误差损失 Mean Absolute Error Loss、Huber Loss、分位数损失 Quantile Loss、交叉熵损失函数 Cross Entropy Loss、Hinge 损失 Hinge Loss

一、适用于回归的损失函数

1、均方差损失 Mean Squared Error Loss

均方差 Mean Squared Error (MSE)  ,也称为 L2 Loss

2、平均绝对误差损失 Mean Absolute Error Loss

平均绝对误差 Mean Absolute Error (MAE) ,也称为 L1 Loss

 

二、适用于分类的损失函数

1、交叉熵损失 Cross Entropy Loss

   二分类的交叉熵损失函数:

 多分类的交叉熵损失函数:

2、合页损失 Hinge Loss

合页损失 Hinge Loss 是一种二分类损失函数,适用于 maximum-margin 的分类,支持向量机 Support Vector Machine (SVM) 模型的损失函数本质上就是 Hinge Loss + L2 正则化。

合页损失 Hinge Loss函数:

 

参考文章和资料:

  • https://mp.weixin.qq.com/s/vSNVIUO1JqwxN6fpViMm1Q
  • Machine Learning: A Probabilistic Perspective

  • Picking Loss Functions - A comparison between MSE, Cross Entropy, and Hinge Loss

  • 5 Regression Loss Functions All Machine Learners Should Know

  • Quantile Regression Demo

更多推荐