当前位置:网站首页>机器学习之逻辑回归(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(神经网络)。
边栏推荐
- How to choose effective keywords
- Will the modified data be updated when it is the same as the original data?
- Zhongang Mining: four steps for sustainable and healthy development of fluorite industry
- 使用cpolar发布树莓派网页(cpolar功能的完善)
- No swagger, what do I use?
- 怎样查询快递物流筛选出无信息单号删除或者复制
- Configuration file settings for remote connection to Windows version server redis
- Summary of research on endogenous information security technology of industrial measurement and control equipment
- Outlook tutorial, how to create an electronic signature in outlook?
- What kind of framework is friendly to developers?
猜你喜欢

Retinal Vessel Segmentation via a Semantics and Multi-Scale Aggregation Network

OpenCV入门基础学习

Introduction to translation professional qualification (level) examination

当 update 修改数据与原数据相同时会被更新吗?

Nucleic acid scanning code registration experience (how to improve the correct character recognition rate of OCR)

Handwritten character recognition

查看端口占用情况

Custom configuration

Discussion on the integration of storage and calculation and the calculation in storage

pytest+allure生成测试报告
随机推荐
Configuration file settings for remote connection to Windows version server redis
【云驻共创】【HCSD大咖直播】亲授大厂面试秘诀
Introduction to translation professional qualification (level) examination
Custom configuration
Summary of introduction to unityshader (2): Beginner Level
手动从0搭建ABP框架-ABP官方完整解决方案和手动搭建简化解决方案实践
Redis command [gradually improved]
附录2-一些简单的练习
Cloud native management practice: business led Devops continuous delivery system
[Apple Developer account]06 after transferring the developer account, the annual fee of the developer is automatically renewed
远程连接windows版本服务器redis的配置文件设置
23 postgraduate entrance examination people hold on! The first wave of exam abandonment peak has arrived!
[unity entry program] C # and unity - understand classes and objects
[centralized training] hcip cloud computing resource exchange post
How to export the old and new file names and locations to excel after file renaming
Network security (5)
STM32 application development practice tutorial: design and implementation of controllable LED water lamp
Virtual machines use host graphics cards (Hyper-V and wsl2)
MySQL converts some table names to uppercase
dataframe.to_sql() 一次性插入过多报错