当前位置:网站首页>Support vector machine for machine learning
Support vector machine for machine learning
2022-07-03 06:10:00 【Master core technology】
One 、 Concept of support vector machine
Support vector machine (Support Vector Machine) It is a kind of generalized linear classifier which classifies data according to supervised learning (generalized linear classifier), The decision boundary is the maximum margin hyperplane for learning samples (maximum-margin hyperplane).
SVM There are three treasures : interval 、 dual 、 Nuclear skills
SVM There are three kinds of :hard-margin SVM、soft-margin、kernel SVM
Given the training sample set D = { ( x 1 , y 1 ) , ( x 2 , y 2 ) , . . . , ( x m , y m ) , } , y i ∈ { − 1 , + 1 } D=\{(x_1,y_1),(x_2,y_2),...,(x_m,y_m),\},y_i\in\{-1,+1\} D={ (x1,y1),(x2,y2),...,(xm,ym),},yi∈{ −1,+1}, Find a hyperplane in the sample space , As far as possible Separate samples of different categories , Make the classification result produced by this partition hyperplane the most robust , See the thick line in the figure below .
The partition hyperplane can be described by the following linear equation :
w T x + b = 0 w^Tx+b=0 wTx+b=0
among w = ( w 1 ; w 2 ; . . . w d ) w=(w_1;w_2;...w_d) w=(w1;w2;...wd) For the normal vector , It determines the direction of the hyperplane ;b Is the displacement term , Determines the distance between the hyperplane and the origin , Partition hyperplane by normal vector w And displacement b determine .
Support vector machine f ( x ) = s i g n ( w T x + b ) f(x)=sign(w^Tx+b) f(x)=sign(wTx+b) It is a classical discriminant model .
Two 、SVM Basic type derivation
SVM Also called Maximum interval classifier , Define the model as :
m a x m a r g i n ( w , b ) = m a x d i s t a n c e ( w , b , x i ) ( 1 ) s . t . { w T x i + b ≥ 0 , y i = + 1 w T x i + b ≤ 0 , y i = − 1 , i = 1 , 2 , . . . , m ( 2 ) max\ margin(w,b)=max\ distance(w,b,x_i) \qquad (1) \\ s.t.\left\{ \begin{aligned} w^Tx_i+b\ge 0,y_i=+1 \\ w^Tx_i+b \le 0,y_i=-1 \end{aligned} \right.,\ i=1,2,...,m\qquad (2) max margin(w,b)=max distance(w,b,xi)(1)s.t.{ wTxi+b≥0,yi=+1wTxi+b≤0,yi=−1, i=1,2,...,m(2)
By way of (2) Telescopic transformation is available :
s . t . { w T x i + b ≥ 1 , y i = + 1 w T x i + b ≤ − 1 , y i = − 1 ( 3 ) s.t.\left\{ \begin{aligned} w^Tx_i+b\ge 1,y_i=+1 \\ w^Tx_i+b \le -1,y_i=-1 \end{aligned}\qquad (3) \right. s.t.{ wTxi+b≥1,yi=+1wTxi+b≤−1,yi=−1(3)
Let a point on the partition hyperplane be x‘, Then there are w T x ′ = − b ( 4 ) w^Tx'=-b\qquad (4) wTx′=−b(4)
Distance formula :
r = ∣ w T ∣ ∣ w ∣ ∣ ( x − x ′ ) ∣ ( cast shadow ) = 1 ∣ ∣ w ∣ ∣ ∣ w T x + b ∣ ( generation Enter into ( 4 ) type ) r=|\frac{w^T}{||w||}(x-x')|( Projection )=\frac{1}{||w||}|w^Tx+b|( Plug in (4) type ) r=∣∣∣w∣∣wT(x−x′)∣( cast shadow )=∣∣w∣∣1∣wTx+b∣( generation Enter into (4) type )
As shown in the figure , These training sample points closest to the hyperplane make (3) The equation equals sign holds , So for the recent point ∣ w T + b ∣ = 1 |w^T+b|=1 ∣wT+b∣=1, They are called ” Support vector “, According to the distance formula :
r = 1 ∣ ∣ w ∣ ∣ ( 5 ) r=\frac1{||w||} \qquad(5) r=∣∣w∣∣1(5)
The sum of the distances from the two heterogeneous support vector machines to the hyperplane is :
γ = 2 ∣ ∣ w ∣ ∣ ( 6 ) \gamma =\frac2{||w||} \qquad(6) γ=∣∣w∣∣2(6)
It's called spacing (margin).
Want to find the maximum interval (maximum margin) The partition hyperplane of , That is to find satisfaction (3) There are three constraint parameters w and b, bring γ \gamma γ Maximum , namely
max w , b = 2 ∣ ∣ w ∣ ∣ s . t . y i ( w T x i + b ) ≥ 1 , i = 1 , 2 , . . . , m ( 7 ) \begin{aligned} &\max\limits_{w,b}=\frac2{||w||}\\ &s.t. \ y_i(w^Tx_i+b)\ge1,i=1,2,...,m \end{aligned}\qquad(7) w,bmax=∣∣w∣∣2s.t. yi(wTxi+b)≥1,i=1,2,...,m(7)
Obviously maximize the interval , Just maximize ∣ ∣ w ∣ ∣ − 1 ||w||^{-1} ∣∣w∣∣−1, This is equivalent to minimizing ∣ ∣ w ∣ ∣ 2 ||w||^{2} ∣∣w∣∣2, therefore (7) Formula rewritten as
min w , b = 1 2 ∣ ∣ w ∣ ∣ 2 s . t . y i ( w T x i + b ) ≥ 1 , i = 1 , 2 , . . . , m ( 8 ) \begin{aligned} &\min\limits_{w,b}=\frac1{2}{||w||}^2\\ &s.t. \ y_i(w^Tx_i+b)\ge1,i=1,2,...,m \end{aligned}\qquad(8) w,bmin=21∣∣w∣∣2s.t. yi(wTxi+b)≥1,i=1,2,...,m(8)
(8) The formula is SVM The basic type of
边栏推荐
- CAD插件的安装和自动加载dll、arx
- [teacher Zhao Yuqiang] Alibaba cloud big data ACP certified Alibaba big data product system
- Txt document download save as solution
- CAD插件的安裝和自動加載dll、arx
- Zhiniu stock -- 03
- 使用 Abp.Zero 搭建第三方登录模块(一):原理篇
- GPS坐标转百度地图坐标的方法
- Why is the website slow to open?
- SVN分支管理
- Cesium entity (entities) entity deletion method
猜你喜欢

Method of converting GPS coordinates to Baidu map coordinates

Convolution operation in convolution neural network CNN

Bernoulli distribution, binomial distribution and Poisson distribution, and the relationship between maximum likelihood (incomplete)

项目总结--01(接口的增删改查;多线程的使用)

Kubesphere - Multi tenant management

Understand expectations (mean / estimate) and variances
![[video of Teacher Zhao Yuqiang's speech on wot] redis high performance cache and persistence](/img/a7/2140744ebad9f1dc0a609254cc618e.jpg)
[video of Teacher Zhao Yuqiang's speech on wot] redis high performance cache and persistence

Simple handwritten ORM framework

Core principles and source code analysis of disruptor

Clickhouse learning notes (I): Clickhouse installation, data type, table engine, SQL operation
随机推荐
智牛股项目--05
MySQL帶二進制的庫錶導出導入
.NET程序配置文件操作(ini,cfg,config)
Apt update and apt upgrade commands - what is the difference?
Multithreading and high concurrency (7) -- from reentrantlock to AQS source code (20000 words, one understanding AQS)
JDBC connection database steps
Bernoulli distribution, binomial distribution and Poisson distribution, and the relationship between maximum likelihood (incomplete)
Svn branch management
Phpstudy setting items can be accessed by other computers on the LAN
. Net program configuration file operation (INI, CFG, config)
The programmer shell with a monthly salary of more than 10000 becomes a grammar skill for secondary school. Do you often use it!!!
The server data is all gone! Thinking caused by a RAID5 crash
Mysql database table export and import with binary
pytorch 搭建神经网络最简版
卷积神经网络CNN中的卷积操作详解
Clickhouse learning notes (I): Clickhouse installation, data type, table engine, SQL operation
Es remote cluster configuration and cross cluster search
Kubernetes notes (V) configuration management
Apple submitted the new MAC model to the regulatory database before the spring conference
Cesium entity (entities) entity deletion method