当前位置:网站首页>统计学习方法——感知机
统计学习方法——感知机
2022-07-07 13:53:00 【_春天_】
感知机是机器学习的最基本模型之一,是神经网络和支持向量机的基础。
感知机的关键词
- 二分类
- 判别模型、线性模型
- 数据集线性可分时,有无穷多个解
- 无法解决XOR问题
感知机的原理
感知机是根据数据实例的特征向量x对其进行二类分类的线形分类模型,输出为+1或-1。感知机的函数为:
f ( x ) = s i g n ( w ⋅ x + b ) f(x)=sign(w·x+b) f(x)=sign(w⋅x+b)
其中 w w w是权值, b b b是偏置, w ⋅ x w·x w⋅x是 w w w和 x x x的内积, s i g n sign sign是符号函数,即,
s i g n ( x ) = { + 1 x ≥ 0 − 1 x < 0 sign(x) = \begin{cases} +1 & x\ge 0\\ -1 & x <0 \end{cases} sign(x)={ +1−1x≥0x<0当wx+b大于0时,根据sign函数,输出为1,对应正类;当wx+b小于0,输出为-1,对应负类。感知机的几何解释:线性方程 w ⋅ x + b = 0 w·x+b=0 w⋅x+b=0 对应于特征空间中一个超平面 S S S,这个超平面将特征空间划分为两个部分,位于两部分的点(特征向量)分别被分为正、负两类。超平面 S S S也被称为分离超平面。
一个线性方程将特征空间分成两部分。在二维特征空间内,wx+b=0即为一条之间,将平面分为两部分,直线上方的点带入wx+b计算值大于0,为正类,对应y值为+1,直线下方的点小于0,为负类,对应y值为-1。感知机学习的策略是极小化损失函 数:
m i n w , b L ( w , b ) = − ∑ y i ( w ⋅ x i + b ) , x i ∈ M min_w, _bL(w,b)=-\sum y_i(w·x_i+b), x_i \in M minw,bL(w,b)=−∑yi(w⋅xi+b),xi∈M
损失函数对应误分类点到分离超平面的总距离。该处的损失函数关注的是误分类点,而不是所有点。损失函数最小为零,即所有的点都分类正确。因此也导致了有无穷多个解。感知机学习算法是基于随机梯度下降法的对损失函数的最优化算法。在原始形式中,首先选取一个超平面,然后用梯度下降法不断极小化目标函数,在这个过程中,一次随机选取一个误分类点使其梯度下降。
当训练数据集线性可分时[补充1],感知机学习算法是收敛的,但是存在无穷多个解,这些解既依赖于处值的选择,也依赖于迭代过程中误分类点的选择顺序。
如果想要得到唯一的超平面,就需要对分离超平面增加约束条件。可参考支持向量机
为什么不能解决异或(XOR)问题
异或问题为二进制运算中,值相同为0,不相同为1。
把异或问题映射到二维空间里,可表示为:

在这个二维空间下,我们找不到一条直线将其分成两类。也就是说无法通过感知机模型将X分到直线的一边,同时将O分到直线的另一边。所以感知机解决不了异或问题。
补充知识
- 补充1:数据集的线性可分性
给定一个数据集
T = { ( x 1 , y 1 ) , ( x 2 , y 2 ) , … , ( x N , y N ) } T=\{(x_1, y_1), (x_2, y_2),…, (x_N, y_N)\} T={ (x1,y1),(x2,y2),…,(xN,yN)}
其中, x i ∈ X = R n x_i \in X = R^n xi∈X=Rn, y i ∈ Y = { + 1 , − 1 } y_i \in Y=\{+1,-1\} yi∈Y={ +1,−1}, i = 1 , 2 , … , N i=1,2,…,N i=1,2,…,N,如果存在某个超平面 S S S
w ⋅ x + b = 0 w·x+b=0 w⋅x+b=0能够将数据集的正实例点和负实例点完全正确地划分到超平面的两侧,即对所有 y i = + 1 y_i=+1 yi=+1的实例 i i i,有 w ⋅ x i + b > 0 w·x_i+b>0 w⋅xi+b>0,对所有 y i = − 1 y_i=-1 yi=−1的实例 i i i,有 w ⋅ x i + b < 0 w·x_i+b<0 w⋅xi+b<0,则称数据集 T T T为线性可分数据集(Linearly separable data set);否则,称数据集 T T T线形不可分。
推荐阅读:
边栏推荐
- Syntaxhighlight highlights the right scroll bar
- After UE4 is packaged, mesh has no material problem
- Regular expression string
- Getting started with webgl (2)
- 航運船公司人工智能AI產品成熟化標准化規模應用,全球港航人工智能/集裝箱人工智能領軍者CIMC中集飛瞳,打造國際航運智能化標杆
- XMIND frame drawing tool
- Aerospace Hongtu information won the bid for the database system research and development project of a unit in Urumqi
- UE4 exports the picture + text combination diagram through ucanvasrendertarget2d
- Detailed explanation of unity hot update knowledge points and introduction to common solution principles
- 用手机在通达信上开户靠谱吗?这样炒股有没有什么安全隐患
猜你喜欢

Rongyun won the 2022 China Xinchuang digital office portal excellence product award!

山东老博会,2022中国智慧养老展会,智能化养老、适老科技展

webgl_ Graphic transformation (rotation, translation, zoom)
![[wechat applet] Chapter (5): basic API interface of wechat applet](/img/63/e819113c7c93e273525bc850892972.png)
[wechat applet] Chapter (5): basic API interface of wechat applet

torch.numel作用

Vite path alias @ configuration

企业级日志分析系统ELK

Three. JS introductory learning notes 00: coordinate system, camera (temporarily understood)

C4D learning notes 1- animation - animation key frames

It's different for rich people to buy a house
随机推荐
AB package details in unity (super detail, features, packaging, loading, manager)
Postman generate timestamp, future timestamp
Tkinter after how to refresh data and cancel refreshing
torch.numel作用
AE learning 01: AE complete project summary
深度之眼(六)——矩阵的逆(附:logistic模型一些想法)
XMIND frame drawing tool
Align individual elements to the right under flex layout
Three. JS introductory learning notes 08:orbitcontrols JS plug-in - mouse control model rotation, zoom in, zoom out, translation, etc
Mesh merging under ue4/ue5 runtime
Shipping companies' AI products are mature, standardized and applied on a large scale. CIMC, the global leader in port and shipping AI / container AI, has built a benchmark for international shipping
Three. JS introductory learning notes 07: external model import -c4d to JSON file for web pages -fbx import
The "go to definition" in VS2010 does not respond or prompts the solution of "symbol not found"
JS array foreach source code parsing
Bidding announcement: 2022 Yunnan Unicom gbase database maintenance public comparison and selection project (second) comparison and selection announcement
2022第四届中国(济南)国际智慧养老产业展览会,山东老博会
Three. JS introductory learning notes 19: how to import FBX static model
应用程序和matlab的通信方式
Use moviepy Editor clips videos and intercepts video clips in batches
./ Functions of configure, make and make install