Support Vector Machines and Kernels
之前一直没搞清楚,这里理一理思路。
总结自 Support Vector Machines and Kernels for Computational Biology、CS229 Lecture note 3 和 ESL。
1. IntroPermalink
To start with, we will be considering a linear classifier for a binary classification problem with labels
Here,
我们称
为 discriminant function。
考虑到 margin 时,我们要注意一个问题,那就是 margin 的度量。按 CS229 Lecture note 3 的说法,实际我们有:
这样其实有点不好记。另一种表达方式是:如果
顺便说一下记号:
叫 inner product (内积) 或者 dot product 称为 vector 的 norm (模) 称为 unit-length vector (单位向量,模为 1)
2. The Non-Linear CasePermalink
There is a straightforward way of turning a linear classifier non-linear, or making it applicable to non-vectorial data. It consists of mapping our data to some vector space, which we will refer to as the feature space, using a function
Note that
这个 mapping
而 Kernel 号称:
Kernel methods avoid this complexity by avoiding the step of explicitly mapping the data to a high dimensional feature-space.
接下来我们就来看下 Kernel 是如何做到这一点的。
3. Lagrange duality 登场Permalink
我们先不考虑
我们要求 maximum margin,就是求
改写一下:
yes!
Let’s find the dual form of the problem. To do so, we need to first minimize
剩下的 dual problem,KTT 什么的我就不推了。把上式代入 discriminant function 有:
Hence, if we’ve found the
4. KernelsPermalink
现在我们再来考虑
这样我们就可以定义 kernel function 为:
除了上一节末尾说的计算方便之外,kernel 还有一个作用就是:我现在可以不用关心
最后,我觉得 kernel 的命名应该是 “kernel of discriminant function” 的意思。
5. Kernel ExamplesPermalink
5.1 Popular KernelsPermalink
Popular choices for
- linear kernel:
- 相当于没有用
或者
- 相当于没有用
- dth-Degree polynomial kernel:
- homogeneous:
- inhomogeneous:
- homogeneous:
- Gaussian kernel:
- Radial basis kernel:
- Neural network kernel:
- tanh is hyperbolic tangent
5.2 Kernels for SequencesPermalink
Support Vector Machines and Kernels for Computational Biology P12 说到了,我就简单写一下。
5.2.1 Kernels Describing -mer ContentPermalink
我们要做的就是把一个 sequence 映射到 feature space 的一个 vector。我们可以这样设计 feature coding:
- 考虑所有的 dimer,以 ACGT 的顺序,
表示 AA 的个数, 表示 AC 的个数,……, 表示 TT 的个数 - 如果要区分 intron 和 exon 的话,那么可以设计成:
表示 intronic AA 的个数,……, 表示 intronic TT 的个数, 表示 exonic AA 的个数,……, 表示 exonic TT 的个数 - 比如一个 sequence 是 intro ACT,那么就只有 intronic AC 和 intronic CT 上是两个 1,其余全 0。这样的一个 vector 称为 sequence 的 spectrum
我们把 sequence 映射到
Since the spectrum kernel allows no mismatches, when
where
5.2.2 Kernels Using Positional InformationPermalink
Analogous to Position Weight Matrices (PWMs), the idea is to analyze sequences of fixed length
where
Comments