当前位置:网站首页>20. Support vector machine - knowledge of mathematical principles
20. Support vector machine - knowledge of mathematical principles
2022-07-31 21:12:00 【WuJiaYFN】
Main content
- Inner product of vectors
- Using the properties of vector inner product to understand SVM
- SVM's method for selecting better decision boundaries
First, the inner product of vectors
1.1 Definition and geometric meaning of inner product

- If there are two vectors u and v , u^Tv is called the inner product between the vectors u and v
- Geometric meaning: The inner product of vectors is equivalent to the product of projection lengths
1.2 Euclidean length (norm)
If there is a vector u, ∥u∥ represents the norm norm of u, that is, the Euclidean length of the vector u, which is a real number
According to the Pythagorean theorem, the norm is calculated as follows:

1.3 Two ways to calculate inner product
(1) u^Tv = u1 × v1 + u2 × v2 = v^Tu
(2) First, project v to the u vector, and record its length as p (positive and negative, positive in the same direction as u, negative in the opposite direction, scalar), then the inner product of the two vectors:
u^Tv = ||u|| · ||v|| · cosθ = ||u|| · p
Note: If the angle between the two vectors is greater than 90°, then p is negative, and the inner product of the two vectors is also negative
Second, use the properties of vector inner product to understand SVM
If C is set very large and A is minimized to 0, then the cost function of SVM will be simplified as shown in the following figure:

For ease of understanding, let's simplify the function expression: let θ0 = 0, and then only have two parameters, θ1 and θ2

- **What the support vector machine does is: **minimize the square of the parameter vector norm, or the square of the length
According to the inner product calculation formula, there is θ^Tx = p · ||θ||, where p is the projection of x on θ.Use p^(i) ⋅ ∥θ∥ instead of θTx(i)

Three, SVM method to select a better decision boundary

We assume that the decision boundary is shown as the green line in the left figure above, and we can know that the parameter vector θ is perpendicular to the boundary (the proof process can be found in another blog post of mine)
It is found that for each sample x(1) and x(2), their projection lengths on θ are very small, then in order to satisfy the condition p(i)·||θ|| ≥1 or p(i)·||θ||≤-1, then ||θ|| should take a large value, which contradicts the previous minimization of the cost function (1/2||θ||2);
The support vector machine tries to make p(i) (the distance from the training sample to the decision boundary) large enough to make the norm of θ small (such as the decision boundary in the right figure above - green line)) to minimize the cost function;
This is how SVM produces the phenomenon of large-spacing classification;Simplifying by letting θ0 = 0 means that we let the decision circle pass through the origin. If θ0 ≠ 0, the decision boundary is no more than the origin , and the conclusion that SVM produces a classifier with a large gap is also true (in the case of a particularly large C).
If you think the article is helpful to you, you can give me a thumbs up and encourage me. Welcome friends to collect articles and study
Follow me, let's learn together and make progress together!!!
边栏推荐
- 【Yugong Series】July 2022 Go Teaching Course 023-List of Go Containers
- Unity 之 音频类型和编码格式介绍
- The whole network is on the verge of triggering, and the all-round assistant for content distribution from media people - Rongmeibao
- uni-app中的renderjs使用
- 有一说一,外包公司到底值不值得去?
- A few permanent free network transmission, convenient and simple (Intranet through tutorials)
- What's wrong with the sql syntax in my sql
- C# 之 扑克游戏 -- 21点规则介绍和代码实现
- 架构实战营模块 8 作业
- Embedded development has no passion, is it normal?
猜你喜欢

Shell 脚本 快速入门到实战 -02

1161. Maximum Sum of Elements in Layer: Hierarchical Traversal Application Problems

统计UTF-8字符串中的字符函数

Shell script quick start to actual combat -02
Cache and Database Consistency Solutions

SiC MOSFET的短路特性及保护

Three. Introduction to js

STM32 full series development firmware installation guide under Arduino framework

Daily practice——Randomly generate an integer between 1-100 and see how many times you can guess.Requirements: The number of guesses cannot exceed 7 times, and after each guess, it will prompt "bigger"

Socket Review and I/0 Model
随机推荐
Thymeleaf是什么?该如何使用。
Several methods of mysql backup table
每月一书(202207):《Swift编程权威指南》
sqlite3 simple operation
Mobile web development 02
Cache and Database Consistency Solutions
The principle of ReentrantLock (to be continued)
Efficient Concurrency: A Detailed Explanation of Synchornized's Lock Optimization
STM32 full series development firmware installation guide under Arduino framework
Linux environment redis cluster to build "recommended collection"
leetcode 665. Non-decreasing Array
Short-circuit characteristics and protection of SiC MOSFETs
ThreadLocal
Redis综述篇:与面试官彻夜长谈Redis缓存、持久化、淘汰机制、哨兵、集群底层原理!...
MySQL---Create and manage databases and data tables
嵌入式开发没有激情了,正常吗?
Basics of ResNet: Principles of Residual Blocks
Carbon教程之 基本语法入门大全 (教程)
1161. Maximum Sum of Elements in Layer: Hierarchical Traversal Application Problems
pytorch lstm时间序列预测问题踩坑「建议收藏」