当前位置:网站首页>Chapter8 Support Vector Machines
Chapter8 Support Vector Machines
2022-07-30 04:29:00 【Sang Zhiwei 0208】
1 理解支持向量机SVM的原理和目标(what)
1.1 原理
SVMThe rationale is to find a linear classifier that maximizes the separation hyperplane in the feature space.
- When the training samples are linearly separable,通过硬间隔最大化,学习一个线性分类器,即线性可分支持向量机.
- When the training data is approximately linearly separable,Slack variables can be introduced,通过软间隔最大化,学习一个线性分类器,即线性支持向量机.
- When the training data is linearly inseparable,通过核函数以及软间隔最大化,Learn about fractional linear support vector machines.
1.2 目标
Find infinite linear functions of all sample distancesf(x,w,b)最小的距离,Find the line with the largest distance among these distances,即求取w,b的值
如图所示:
,其中
代表向量.
The sample distance is the distance between this function:
所以目标为:

2 掌握支持向量机的计算过程和算法步骤(how)
2.1 计算过程
假设给定一个特征空间上的训练数据集
,其中
;
表示为第i个实例(若n大于1,则
为向量);
为
的类标记,即当
时,
为正例,当
时
为负例.
称为样本点.
给定线性可分训练数据集,The separating hyperplane obtained by maximizing the interval is
,相应的分类决策函数
,该决策函数称为线性可分支持向量机.
是某个确定的特征空间转换函数,它的作用是将x映射到(最高的)维度.
Solve the separating hyperplane problem=Solve the corresponding convex quadratic programming problem.
(1)根据题设
,有当
,
从而
.【
为预测值
为真实值】
change by a certain percentagew,b(The position of the hyperplane does not change at this time,But the function interval can be changed),则t*yThe value also changes,从而:
,其中
为
的
范数.
目标函数:![\underset{w,b}{argmax}\left \{ \frac{1}{||w||}\underset{i}{min} [y_{i}\cdot (w^{T}\cdot \Phi (x_{i})+b)]\right \}](http://img.inotgo.com/imagesLocal/202207/30/202207300416099824_39.gif)
(2)(If the geometric distance is B,即
(B为常数)

Divide both sides of the equation byB:
,At this point the geometric distance becomes 1.

通过等比例缩放w的方法,The function values of these two types of points are satisfied
,即约束条件.

(3)So the original problem can be transformed into the following problem:
约束条件——
原目标函数——![\underset{w,b}{argmax}\left \{ \frac{1}{||w||}\underset{i}{min} [y_{i}\cdot (w^{T}\cdot \Phi (x_{i})+b)]\right \}](http://img.inotgo.com/imagesLocal/202207/30/202207300416099824_39.gif)
新目标函数——
,即
,即
(4)所用方法:拉格朗日乘子法
设函数
原问题是极小极大问题:
The dual problem of the primal problem is the minimax problem:
然后分别对
求偏导,令其为0:



即在
Solve under constraints:

Add a minus sign to solve:


2.2 举例说明



我们可以看到
,则
is a non-support vector.
2.3 拉格朗日乘子法
约束条件:
,
目标:
构造函数:
,其中
任意值.
所以
(原始问题)
对偶函数为 
所以接下来对
求导,使其为0.
3 Understand what it means to maximize soft spacing
When the training data is approximately linearly separable,The slack variable can be increased
,通过软间隔最大化,Make the sinicization interval plus the slack variable greater than or equal to1,Thus the constraints become
,And the objective function becomes 
CThe smaller the transition band, the wider,So it has generalization ability.C大时,to minimize the objective function,Actually need to make
,becomes linearly separable.
所以:with relaxation factorSVM拉格朗日函数如下:




ps:Actually the loss function is 
边栏推荐
猜你喜欢

New LaaS protocol Elephant Swap provides ePLATO with sustainable premium space

Pytorch framework learning record 7 - convolutional layer
Go 学习笔记(84)— Go 项目目录结构

The VUX Datetime component compute-days-function dynamically sets the date list

Introduction to database - MySQL simple introduction

QT(39)-vs开发qt程序提示无法打开源文件

Pytorch框架学习记录5——DataLoader的使用

网页元素解析a标签

Eureka Registry

MySQL 字符串拼接 - 多种字符串拼接实战案例
随机推荐
The first day of Flink learning - what is batch and streaming computing?
How to Effectively Conduct Retrospective Meetings (Part 1)?
《构建之法》笔记---第十章 典型用户和场景
cv2.polylines
山西省第二届网络安全技能大赛(企业组)部分赛题WP(八)
Is the end of the universe a bank?Talk about those things about doing software testing in the bank
PyG搭建R-GCN实现节点分类
Hongji was once again shortlisted in the Gartner 2022 RPA Magic Quadrant and achieved a significant jump in position
2021 Shandong Province Network Construction and Application Test Questions
【周周有奖】云原生编程挑战赛“边缘容器”赛道邀你来战!
KubeMeet 报名 | 「边缘原生」线上技术沙龙完整议程公布!
Roperties类配置文件&DOS查看主机网络情况
【MySQL系列】-B+树索引和HASH索引有什么区别
Unity3D Application模拟进入前后台及暂停
Go 学习笔记(84)— Go 项目目录结构
深圳见!云原生加速应用构建专场:来看云原生 FinOps、SRE、高性能计算场景最佳实践
2.6 Merge Sort
Mysql version upgrade, copy the Data file directly, the query is very slow
Thymeleaf简介
小程序 wx.miniProgram.navigateTo 跳转地址不能是tabbar地址