当前位置:网站首页>【笔记】逻辑斯蒂回归
【笔记】逻辑斯蒂回归
2022-07-27 12:54:00 【Sprite.Nym】
一、逻辑斯蒂回归概述
(1)逻辑斯蒂回归的目的:分类。
逻辑斯蒂回归常常解决分类问题,特别是二分类问题。
(2)逻辑斯蒂回归的过程:回归。
计算结果是0~1之间的连续值,代表发生的可能性(类概率)。
(3)阈值:通过可能性和阈值的比较完成分类。
如:算出违约的可能性,如果大于0.5,则将借款人分类为坏客户。
二、逻辑斯蒂回归模型
由于二分类问题中,标签只有是和否(1和0),如果用线性回归进行拟合,线性回归的值域不在0 ~ 1之间,预测结果难以作为可能性输出。而如果用分段函数进行拟合,由于分段函数并不连续,预测结果不是我们希望的可能性0 ~ 1的连续值。
解决办法就是将线性回归和sigmoid函数结合起来,即组成一个嵌套函数。
sigmoid函数图像:

组成的嵌套函数:
三、逻辑斯蒂回归的损失函数
如果直接将最小二乘法中的 y ^ \hat y y^ 替换成sigmoid函数作为逻辑斯蒂回归的损失函数来求最小值,会发现这个函数并不是凸函数,因此采用别的损失函数。
(1)二分类问题中y的概率
由于约定 y ^ = P ( y = 1 ∣ x ) \hat y=P(y=1|x) y^=P(y=1∣x) ,所以:
y = 1 y=1 y=1 时, P ( y ∣ x ) = y ^ P(y|x)=\hat y P(y∣x)=y^
y = 0 y=0 y=0 时, P ( y ∣ x ) = 1 − y ^ P(y|x)=1-\hat y P(y∣x)=1−y^
合并得到:
P ( y ∣ x ) = y ^ y ( 1 − y ^ ) ( 1 − y ) P(y|x)={\hat y}^y(1-\hat y)^{(1-y)} P(y∣x)=y^y(1−y^)(1−y)
(2)利用最大似然估计法估计模型参数
似然函数为:
对数似然函数为:
对极大似然函数求极大值,即可得到最理想的参数值。因此对于整个训练集,可以将代价函数定义为:

边栏推荐
- Crop the large size image of target detection into a fixed size image
- Small program completion work wechat campus laundry small program graduation design finished product (2) small program function
- Come and watch, 17 practical skills of operation and maintenance~
- PCL common operations
- 关于max做动画的一些关键信息(shift+v)
- 16 VMware horizon 2203 virtual desktop-win10 automatic desktop pool full clone dedicated (XVI)
- MySQL startup options and configuration files
- Application layer World Wide Web WWW
- Brief tutorial for soft exam system architecture designer | system design
- Various ways to use new
猜你喜欢

Seata's landing practice in ant International Banking

redis集群搭建-使用docker快速搭建一个测试redis集群

小程序毕设作品之微信校园洗衣小程序毕业设计成品(4)开题报告

Hcip - OSPF comprehensive experiment

NoSQL —— NoSQL 三大理论基石 —— CAP —— BASE—— 最终一致性

The universe has no end. Can utonmos shine the meta universe into reality?

Fiddler bag capturing Tool + night God simulator

opencv图像的缩放平移及旋转

Futures Commission Standard and margin ratio

Echart line chart displays the last point and vertical dotted line by default
随机推荐
Software testing system architecture designer concise tutorial | software testing
egg-swagger-doc 图形验证码解决方案
Data enhancement in image processing
JS divides the array into two-dimensional arrays according to the specified attribute values
不需要标注数据的语义分割!ETH&鲁汶大学提出MaskDistill,用Transformer来进行无监督语义分割,SOTA!...
Selenium eight elements positioning and relative locator
Wechat campus laundry applet graduation design finished product (5) assignment
Leetcode Tencent selected exercises 50 questions -059. Spiral matrix II
宇宙没有尽头,UTONMOS能否将元宇宙照进现实?
opencv图像的缩放平移及旋转
See if you are on the shortlist of each division
Small program completion work wechat campus laundry small program graduation design finished product (2) small program function
[C Advanced] pointer array vs array pointer
Crop the large size image of target detection into a fixed size image
Oppo self-developed large-scale knowledge map and its application in digital intelligence engineering
纯c手写线程池
关于max做动画的一些关键信息(shift+v)
PCL 常用操作
GoPro接入 - 根据GoPro官方文档/Demo,实现对GoPro的控制和预览
Summary of scaling and coding methods in Feature Engineering