损失函数(Loss Function) -1
http://www.ics.uci.edu/~dramanan/teaching/ics273a_winter08/lectures/lecture14.pdf
- Loss Function
损失函数可以看做 误差部分(loss term) + 正则化部分(regularization term)

1.1 Loss Term
- Gold Standard (ideal case)
- Hinge (SVM, soft margin)
- Log (logistic regression, cross entropy error)
- Squared loss (linear regression)
- Exponential loss (Boosting)
Gold Standard 又被称为0-1 loss, 记录分类错误的次数

Hinge Loss http://en.wikipedia.org/wiki/Hinge_loss
For an intended output t = ±1 and a classifier score y, the hinge loss of the prediction y is defined as

Note that y should be the "raw" output of the classifier's decision function, not the predicted class label. E.g., in linear SVMs,

It can be seen that when t and y have the same sign (meaning y predicts the right class) and

, the hinge loss

, but when they have opposite sign,

increases linearly with y (one-sided error).
来自 <http://en.wikipedia.org/wiki/Hinge_loss>

Plot of hinge loss (blue) vs. zero-one loss (misclassification, green:y < 0) for t = 1 and variable y. Note that the hinge loss penalizes predictions y < 1, corresponding to the notion of a margin in a support vector machine.
来自 <http://en.wikipedia.org/wiki/Hinge_loss>

在Pegasos: Primal Estimated sub-GrAdient SOlver for SVM论文中

这里把第一部分看成正规化部分,第二部分看成误差部分,注意对比ng关于svm的课件
不考虑规则化

考虑规则化

Log Loss
Ng的课件1,先是讲 linear regression 然后引出最小二乘误差,之后概率角度高斯分布解释最小误差。
然后讲逻辑回归,使用MLE来引出优化目标是使得所见到的训练数据出现概率最大



最大化下面的log似然函数

而这个恰恰就是最小化cross entropy!
http://en.wikipedia.org/wiki/Cross_entropy
http://www.cnblogs.com/rocketfan/p/3350450.html 信息论,交叉熵与KL divergence关系


Cross entropy can be used to define loss function in machine learning and optimization. The true probability

is the true label, and the given distribution

is the predicted value of the current model.
More specifically, let us consider logistic regression, which (in its most basic guise) deals with classifying a given set of data points into two possible classes generically labelled

and

. The logistic regression model thus predicts an output

, given an input vector

. The probability is modeled using thelogistic function

. Namely, the probability of finding the output

is given by

where the vector of weights

is learned through some appropriate algorithm such as gradient descent. Similarly, the conjugate probability of finding the output

is simply given by

The true (observed) probabilities can be expressed similarly as

and

.
Having set up our notation,

and

, we can use cross entropy to get a measure for similarity between

and

:

The typical loss function that one uses in logistic regression is computed by taking the average of all cross-entropies in the sample. For specifically, suppose we have

samples with each sample labeled by

. The loss function is then given by:

where

, with

the logistic function as before.
The logistic loss is sometimes called cross-entropy loss. It's also known as log loss (In this case, the binary label is often denoted by {-1,+1}).[1]
来自 <http://en.wikipedia.org/wiki/Cross_entropy>
因此和ng从MLE角度给出的结论是完全一致的! 差别是最外面的一个负号
也就是逻辑回归的优化目标函数是 交叉熵

修正 14.8这个公式 课件里面应该写错了一点 第一个+ 应该是-,这样对应loss 优化目标是越小越好,MLE对应越大也好。
squared loss

exponential loss

指数误差通常用在boosting中,指数误差始终> 0,但是确保越接近正确的结果误差越小,反之越大。
损失函数(Loss Function) -1的更多相关文章
- 损失函数(Loss function) 和 代价函数(Cost function)
1损失函数和代价函数的区别: 损失函数(Loss function):指单个训练样本进行预测的结果与实际结果的误差. 代价函数(Cost function):整个训练集,所有样本误差总和(所有损失函数 ...
- 损失函数(loss function)
通常而言,损失函数由损失项(loss term)和正则项(regularization term)组成.发现一份不错的介绍资料: http://www.ics.uci.edu/~dramanan/te ...
- 损失函数(loss function) 转
原文:http://luowei828.blog.163.com/blog/static/310312042013101401524824 通常而言,损失函数由损失项(loss term)和正则项(r ...
- 惩罚因子(penalty term)与损失函数(loss function)
penalty term 和 loss function 看起来很相似,但其实二者完全不同. 惩罚因子: penalty term的作用是把受限优化问题转化为非受限优化问题. 比如我们要优化: min ...
- loss function与cost function
实际上,代价函数(cost function)和损失函数(loss function 亦称为 error function)是同义的.它们都是事先定义一个假设函数(hypothesis),通过训练集由 ...
- [machine learning] Loss Function view
[machine learning] Loss Function view 有关Loss Function(LF),只想说,终于写了 一.Loss Function 什么是Loss Function? ...
- 【深度学习】一文读懂机器学习常用损失函数(Loss Function)
最近太忙已经好久没有写博客了,今天整理分享一篇关于损失函数的文章吧,以前对损失函数的理解不够深入,没有真正理解每个损失函数的特点以及应用范围,如果文中有任何错误,请各位朋友指教,谢谢~ 损失函数(lo ...
- 机器学习 损失函数(Loss/Error Function)、代价函数(Cost Function)和目标函数(Objective function)
损失函数(Loss/Error Function): 计算单个训练集的误差,例如:欧氏距离,交叉熵,对比损失,合页损失 代价函数(Cost Function): 计算整个训练集所有损失之和的平均值 至 ...
- 对数损失函数(Logarithmic Loss Function)的原理和 Python 实现
原理 对数损失, 即对数似然损失(Log-likelihood Loss), 也称逻辑斯谛回归损失(Logistic Loss)或交叉熵损失(cross-entropy Loss), 是在概率估计上定 ...
随机推荐
- iOS——Core Animation 知识摘抄(四)
原文地址http://www.cocoachina.com/ios/20150106/10840.html 延迟解压 一旦图片文件被加载就必须要进行解码,解码过程是一个相当复杂的任务,需要消耗非常长的 ...
- Java中反射的理解
反射 一.什么是反射 Java 反射是Java语言的一个很重要的特征,它使得Java具体了"动态性". 反射用在 Java 身上指的是我们可以于运行时加载.探知.使用编译期间完全未 ...
- Atitit 颜色平均值cloor grb hsv模式的区别对比
Atitit 颜色平均值cloor grb hsv模式的区别对比 使用hsv模式平均后会变得更加的靓丽一些..2 public class imgT { public static void main ...
- Atitit.架构设计趋势 设计模式 ---微服务架构 soa
Atitit.架构设计趋势 设计模式 ---微服务架构 soa 什么是微服务架构?1 .微服务与SOA的关系 :微服务架架构师面向服务架构(SOA)的一种特定实现1 微服务与康威定律2 微服务的一些 ...
- iOS 屏幕适配:autoResizing autoLayout和sizeClass
1. autoResizing autoresizing是苹果早期的ui布局适配的解决办法,iOS6之前完全可以胜任了,因为苹果手机只有3.5寸的屏幕,在加上手机app很少支持横屏,所以iOS开发者基 ...
- mysql创建数据库
mysql创建数据库 创建utf8编码的数据库 CREATE DATABASE IF NOT EXISTS my_db default character set utf8 COLLATE utf8_ ...
- css知多少(5)——选择器
1. 引言 从本节开始,就进入本系列的第二个部分——css和html的结合——说白了就是选择器. CSS中定义了样式,如何将这些样式设置到相应的html节点上?就不得不通过选择器.让浏览器知道css选 ...
- datagridview控件去除页码
开启datagridview的分页功能,默认页码是是显示的 为了不让页码显示,可以在绑定数据的是将其隐藏掉 gvLogName.BottomPagerRow.Visible = false; gvLo ...
- 替换变量&和&&
替换变量可看作是占位符 一. 单个&符号替换 SQL语句中最基本.最普遍元素替换形式是单个&符号替换.&符号是用来在语句中指定替换变量的符号.当执行语句时,Oracle服务器处 ...
- Floyd算法(二)之 C++详解
本章是弗洛伊德算法的C++实现. 目录 1. 弗洛伊德算法介绍 2. 弗洛伊德算法图解 3. 弗洛伊德算法的代码说明 4. 弗洛伊德算法的源码 转载请注明出处:http://www.cnblogs.c ...