logistics Regression using Gradient Descent

回归来源于"线性回归"的z=XW,使用线性回归去拟合逼近一个’界’,使得按照这个界进行数据分类后得到的cost最小(决策边界).

Function:
for two way classification and give it realtive probablities.
such as

  • differentiate whether it is junk mail
  • distinguish whether this customer will buy the product

it can be extended to muti-classfication problems

Function Sigmoid
在这里插入图片描述

this function can accept all the input and map it to 0 or 1, suitable for classification

  • 0≤hθ(x)≤1

it mainly because -z to the power of e is always smaller than 1 and the denominator is always bigger than 1 , as a result , it always smaller than 1, In other words, it can be seen as probability.
在这里插入图片描述

在这里插入图片描述
w0 is intercept(截距), w1 w2 is coefficient(系数)
the main formula to caculate weights

Cost for classfication

when the label == 1

cost = -log(h)

h in this formula is probabilty been classified as label 1

在这里插入图片描述
when the label == 0

cost = -log(1-h)

h in this formula is probabilty been classified as label 0

在这里插入图片描述
P(y=1|x;θ) 表示 x在样本θ下为1的概率
在这里插入图片描述
so the total cost of classification is
在这里插入图片描述

接下来就是找出最小的θ,使得cost function达到最小

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值