image.png

A two-class dataset that is not linearly separable. The outer ring (cyan) is class ‘0’, while the inner ring (red) is class ‘1’

  • Linearly inseparable training data. Unlike the linearly separable data, it is not possible to draw a straight (linear) line to separate the classes.
  • Basic SVM would not be able to find a feasible solution here.
  • But there is a way to extend the linear approach in this case!

无法用一条直线去区分两个分类区域,基础向量机无法提供可行解,但是存在一种可扩展的线性方法。

Kernel Trick

思路:通过将数据映射到高维空间来获得线性分离
The idea is to obtain linear separation by mapping the data to a higher dimensional space. Let’s see the example first:image.png> (Left) A dataset in Linearly Inseparable Case 线性不可分情况 - 图3, not linearly separable. (Right) The same dataset transformed by the transformation: Linearly Inseparable Case 线性不可分情况 - 图4image.pngHyperplane (green plane) that linearly separates two classes in the higher dimensional space.
In the above example, we can train a linear SVM classifier that successfully finds a good decision boundary in Linearly Inseparable Case 线性不可分情况 - 图6.
However, we are given the dataset in Linearly Inseparable Case 线性不可分情况 - 图7. The challenge is to find a transformation Linearly Inseparable Case 线性不可分情况 - 图8, such that the transformed dataset is linearly separable in Linearly Inseparable Case 线性不可分情况 - 图9 . 难点在于如何将低纬数据向高维转化。
Linearly Inseparable Case 线性不可分情况 - 图10, which after applied to every point in the original tuples yields the linearly separable dataset.

Assuming we have such a transformation Linearly Inseparable Case 线性不可分情况 - 图11 , the new classification pipeline is as follows.

  • First transform the training set Linearly Inseparable Case 线性不可分情况 - 图12 to Linearly Inseparable Case 线性不可分情况 - 图13 with Linearly Inseparable Case 线性不可分情况 - 图14 . 先把低维数据向高纬转化。
  • Train a linear SVM on Linearly Inseparable Case 线性不可分情况 - 图15 to get a new SVM. 使用高维数据训练支持向量机。
  • At test time, a new example Linearly Inseparable Case 线性不可分情况 - 图16 will first be transformed to Linearly Inseparable Case 线性不可分情况 - 图17 during the testing time. 测试时,样例会被转化为高维。