前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Logistic Regression cost function and Maximum likehood estimate

Logistic Regression cost function and Maximum likehood estimate

作者头像
Steve Wang
发布2019-05-28 17:43:34
4260
发布2019-05-28 17:43:34
举报
文章被收录于专栏:从流域到海域从流域到海域

Logistic Regression cost function

The original form is y^, here we simplified by using y’ because of the latex grammar.

Ify=1:p(y∣x)=y′If y = 1: p(y|x) = y'Ify=1:p(y∣x)=y′ Ify=0:p(y∣x)=1−y′If y = 0: p(y|x) = 1-y'Ify=0:p(y∣x)=1−y′

Summarize−>p(y∣x)=y′y(1−y)1−ySummarize -> p(y|x) = y'^y (1-y)^{1-y}Summarize−>p(y∣x)=y′y(1−y)1−y This one equation can express that: Ify=1:p(y∣x)=y′If y = 1: p(y|x) = y'Ify=1:p(y∣x)=y′ Ify=0:p(y∣x)=1−y′If y = 0: p(y|x) = 1-y'Ify=0:p(y∣x)=1−y′ The log function is a strictly monotonically increasing. Maximizing log(p(y∣x))log(p(y|x))log(p(y∣x)) give you a similar result that is optimizing p(y|x) and if you compute log of p(y|x) -> log p(y∣x)=log(y′y(1−y)1−y)=ylogy′+(1−y)log(1−y′)log\ p(y|x)=log (y'^y (1-y)^{1-y}) =ylogy' +(1-y)log(1-y')log p(y∣x)=log(y′y(1−y)1−y)=ylogy′+(1−y)log(1−y′) =−l(y′,y)=-l(y',y)=−l(y′,y) note: l represents loss function here. Minimizing the loss function corresponds to maximum the log of the probability. This is what the loss funcion on a single example looks like.

Cost on m examples

log p(labels in thetraining set)=log∏i=1mp(y′i,y′)log\ p(labels\ in \ the training \ set) = log \prod_{i=1}^mp(y'^i,y')log p(labels in thetraining set)=logi=1∏m​p(y′i,y′) log p(...)=∑i=1mlog p(yi∣xi)=−∑i=1ml(y′i,yi)log\ p(...) = \sum_{i=1}^mlog\ p(y^i|x^i)=-\sum_{i=1}^ml(y'^i,y^i)log p(...)=i=1∑m​log p(yi∣xi)=−i=1∑m​l(y′i,yi)

Maximum likelihood estimation

And so in statistics, there’s a principle called the principal of maximum likelihood estimation,which just means choose the parameters that maximizes this thing(refer to above).

Cost function: Because we want to minimize the cost, instead of maximizing likelihood we’ve got rid of negative. And then finally for convenience, we make sure that our quantities are better scale, we just add a 1 over m extra scaling factor there. J(w,b)=1m∑i=1ml(y′i,yi)J(w,b) =\frac{1}{m}\sum_{i=1}^ml(y'^i,y^i)J(w,b)=m1​i=1∑m​l(y′i,yi)

But to summarize, by minimizing this cost function J(w,b), we’re really carrying out maximum likelihood estimation Under the assumption that our training examples were IID or identically independently distributed.

Reference

https://mooc.study.163.com/learn/2001281002?tid=2001392029#/learn/content?type=detail&id=2001702014 Maximum likelihood Estimate https://blog.csdn.net/zengxiantao1994/article/details/72787849

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2018年11月21日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Logistic Regression cost function
  • Cost on m examples
  • Maximum likelihood estimation
  • Reference
相关产品与服务
对象存储
对象存储(Cloud Object Storage,COS)是由腾讯云推出的无目录层次结构、无数据格式限制,可容纳海量数据且支持 HTTP/HTTPS 协议访问的分布式存储服务。腾讯云 COS 的存储桶空间无容量上限,无需分区管理,适用于 CDN 数据分发、数据万象处理或大数据计算与分析的数据湖等多种场景。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档