当前位置:网站首页>机器学习 05:非线性支持向量机
机器学习 05:非线性支持向量机
2022-06-26 05:36:00 【SP FA】
主要思想
定理:
对于线性不可分的点,一定可以有一个维度使其线性可分。
基于此定理,我们可以使用支持向量机解决线性不可分的数据,即把数据集映射到一个高纬度,之后再进行线性分类。
升维
假设原先的样本点是 x ⃗ i \vec x_i xi,用 ϕ ( x ⃗ i ) \phi(\vec x_i) ϕ(xi) 表示映射到新的特征空间后的新样本点。那么分割超平面可以表示为
f ( x ⃗ ) = w ⃗ ϕ ( x ⃗ ) + b f(\vec x)=\vec w\phi(\vec x)+b f(x)=wϕ(x)+b
于是非线性支持向量机的对偶问题就成了:
max α ⃗ ∑ i = 1 N α i − 1 2 ∑ i = 1 N ∑ j = 1 N α i α j y i y j ϕ ( x ⃗ i ) T ϕ ( x ⃗ j ) s . t . ∑ i = 1 N α i y i = 0 , 0 ≤ α i ≤ C \max\limits_{\vec\alpha}\sum\limits^N_{i=1}\alpha_i-\frac{1}{2}\sum\limits^N_{i=1}\sum\limits^N_{j=1}\alpha_i\alpha_jy_iy_j\phi(\vec x_i)^T\phi(\vec x_j)\\s.t.\ \sum\limits^N_{i=1}\alpha_iy_i=0,\ 0\le\alpha_i\le C αmaxi=1∑Nαi−21i=1∑Nj=1∑Nαiαjyiyjϕ(xi)Tϕ(xj)s.t. i=1∑Nαiyi=0, 0≤αi≤C
但是从低维空间映射到高维空间后的维度可能很高,这样会大大增加 ϕ ( x ⃗ i ) T ϕ ( x ⃗ j ) \phi(\vec x_i)^T\phi(\vec x_j) ϕ(xi)Tϕ(xj) 的计算量,所以需要通过其它办法来简化运算。这就用到了核函数。
核函数
核函数的作用
由于目标函数和分类决策函数都只涉及样本之间的内积,所以不需要显式地指定非线性变换,而是用核函数替换当中的内积。设 K ( x , z ) K(x,z) K(x,z) 是一个核函数,或正定核,则存在一个从输入空间到特征空间的映射 ϕ ( x ⃗ ) \phi(\vec x) ϕ(x),对任意输入空间的 x ⃗ , z ⃗ \vec x,\vec z x,z 有
K ( x ⃗ , z ⃗ ) = ϕ ( x ⃗ ) ⋅ ϕ ( z ⃗ ) K(\vec x,\vec z)=\phi(\vec x)\cdot\phi(\vec z) K(x,z)=ϕ(x)⋅ϕ(z)
假设我们的输入空间是 m m m 维,特征空间是 d d d 维,那么通过核函数就可以把 d d d 维运算降到 m m m 维运算。当 d d d 非常大甚至是无穷时,核函数可以减少大量的运算。
常见的核函数
线性核函数: K ( x ⃗ i , x ⃗ j ) = x ⃗ i T x ⃗ j + c K(\vec x_i,\vec x_j)=\vec x_i^T\vec x_j+c K(xi,xj)=xiTxj+c
多项式核函数: K ( x ⃗ i , x ⃗ j ) = ( α x ⃗ i T x ⃗ j + c ) d K(\vec x_i,\vec x_j)=(\alpha\vec x_i^T\vec x_j+c)^d K(xi,xj)=(αxiTxj+c)d
径向基核函数(高斯核函数): K ( x ⃗ i , x ⃗ j ) = e − γ ∥ x ⃗ i − x ⃗ j ∥ 2 K(\vec x_i,\vec x_j)=e^{-\gamma\parallel\vec x_i-\vec x_j\parallel^2} K(xi,xj)=e−γ∥xi−xj∥2
s i g m o d sigmod sigmod 核函数: K ( x ⃗ i , x ⃗ j ) = tanh ( α x ⃗ i T x ⃗ j + c ) K(\vec x_i,\vec x_j)=\tanh(\alpha\vec x_i^T\vec x_j+c) K(xi,xj)=tanh(αxiTxj+c)
同步更新于:SP-FA 的博客
边栏推荐
- How to rewrite a pseudo static URL created by zenpart
- C# 40. Byte[] to hexadecimal string
- Introduction to GUI programming to game practice (I)
- What management systems (Updates) for things like this
- Pre-Sale Analysis
- 使用Jedis監聽Redis Stream 實現消息隊列功能
- data = self._ data_ queue. get(timeout=timeout)
- bingc(继承)
- [upsampling method opencv interpolation]
- 【活动推荐】云原生、产业互联网、低代码、Web3、元宇宙……哪个是 2022 年架构热点?...
猜你喜欢

Leetcode513. Find the value in the lower left corner of the tree

Installation and deployment of alluxio

cartographer_ backend_ constraint
转帖——不要迷失在技术的海洋中

MySQL数据库-01数据库概述

Experience of reading the road to wealth and freedom

Replacing domestic image sources in openwrt for soft routing (take Alibaba cloud as an example)

pytorch(网络模型训练)

SOFA Weekly | 开源人—于雨、本周 QA、本周 Contributor

AutowiredAnnotationBeanPostProcessor什么时候被实例化的?
随机推荐
Redis installation on Linux
操作符的优先级、结合性、是否控制求值顺序【详解】
Installation and deployment of alluxio
About abstact and virtual
SOFA Weekly | 开源人—于雨、本周 QA、本周 Contributor
新的征程
data = self._ data_ queue. get(timeout=timeout)
转帖——不要迷失在技术的海洋中
【ARM】在NUC977上搭建基于boa的嵌入式web服务器
Redis discovery bloom filter
[activity recommendation] cloud native, industrial Internet, low code, Web3, metauniverse... Which is the architecture hot spot in 2022
【MYSQL】MySQL 百万级数据量分页查询方法及其优化
慢慢学JVM之缓存行和伪共享
RIA ideas
Mysql 源码阅读(二)登录连接调试
Sofa weekly | open source person - Yu Yu, QA this week, contributor this week
Feelings of virtual project failure
When was the autowiredannotationbeanpostprocessor instantiated?
[arm] build boa based embedded web server on nuc977
Daily production training report (16)