当前位置:网站首页>机器学习之逻辑回归(Logistics Regression)
机器学习之逻辑回归(Logistics Regression)
2022-07-29 09:36:00 【Cyril-KI】
“逻辑回归(Logistic Regression)与线性回归(Linear Regression)都是一种广义线性模型(generalized linear model), 因此逻辑回归与线性回归有很多相同之处,去除Sigmoid映射函数的话,逻辑回归算法就是一个线性回归。”
逻辑回归虽然带有“回归”二字,但其本质却是一个经典的二分类算法。对于线性回归,其输出值可以是任意值,比如我要预测2025年的房价,训练出模型并应用之后得到的是一个具体的数值;而分类的话得到的答案是1 or 0,1表示属于该类,0表示不属于该类。
01
—
Sigmoid
图像:
02
—
Loss Function的推导
逻辑回归的损失函数我们采用的是一种交叉熵,而不是线性回归里面的Square Error,解释如下:
从推导可以看出,对逻辑回归假若使用Square Error,无论 =1还是0,都是靠近最优解的,这显然是不合理的。
借用一张图可以更加具体地说明这个问题:
距离target越远,我们应该更快地更新参数,即距离越远微分值应该越大,梯度下降时移动的距离就越远。but对于Square Error,即使距离很远,微分值也会非常小,移动到target的速度就非常慢了。
03
—
逻辑回归的限制
这时候我们发现,就能够找到一条直线将两类点分开,但在实际应用中,我们往往不能够找到比较好的特征变换的方法。
事实上,Feature Transformation也可以用一个逻辑回归模型来实现,如下所示:
第一个逻辑回归是实现了特征转换,第二个逻辑回归实现了分类。
在这里,就引入了Deep Learning的概念。一个逻辑回归的输入可以来源于其他逻辑回归的输出,这个逻辑回归的输出也可以是其他逻辑回归的输入。把每个逻辑回归称为一个 Neuron(神经元),把这些神经元连接起来的网络,就叫做 Neural Network(神经网络)。
边栏推荐
- Shutter gradient
- mysql将部分表名统一转换为大写
- 查看端口占用情况
- How to contribute to openharmony
- In simple terms, dependency injection and its application in Tiktok live broadcast
- A structured random inactivation UNET for retinal vascular segmentation
- 使用cpolar发布树莓派网页(cpolar隧道的完善)
- OpenCV入门基础学习
- Fluent text editor
- Nucleic acid scanning code registration experience (how to improve the correct character recognition rate of OCR)
猜你喜欢

Data type of MySQL

Zhongang Mining: four steps for sustainable and healthy development of fluorite industry

HarmonyOS 3.0 发布!

不用Swagger,那我用啥?

Axurerp prototype design starts quickly

Using logistic regression and neural network to deal with complex binary classification problems

Evaluation index of machine learning classification model and implementation of sklearn code

Qmainwindow details

Basic operations of OpenCV image processing

Outlook tutorial, how to create an electronic signature in outlook?
随机推荐
Appendix 2 – some simple exercises
dataframe.to_sql() 一次性插入过多报错
MySQL的数据类型
先序遍历/后序遍历确定树的大致形态
PyQt5快速开发与实战 6.4 QBoxLayout(框布局)
Visual Studio
RTMP supports h265 streaming
Shutter gradient
附录2-一些简单的练习
NFA determination and DFA minimization based on C language
Network security (6)
23 postgraduate entrance examination people hold on! The first wave of exam abandonment peak has arrived!
How to realize the isolation level between MySQL transactions and mvcc
Solve the problem of reading data garbled by redis visualization tool
AxureRP原型设计 快速开始
机器学习之分类模型评估指标及sklearn代码实现
PyQt5快速开发与实战 6.5 QGridLayout(网格布局)
Behind 100000 visits...
[unity entry program] collection of common learning websites
远程连接windows版本服务器redis的配置文件设置