最近一段时间一直在看Andrew Ng的机器学习课程,看到SVM中的geometric margin 的推导过程的时候比较迷茫,下面是Ng的原话:
The decision boundary corresponding to ( ω , b ) \left ( \omega ,b \right ) (ω,b) is shown, along with the vector $\omega $. Note that $\omega $ is orthogonal (at 9 0 ∘ 90^{\circ} 90∘ ) to the separating hyperplane. (You should convince yourself that this must be the case.)
他说这个$\omega $一定是垂直于超平面的,我之前想了好久,到最后终于想明白了。
下面是他讲义中的原图:
有如下公式,
ω
=
(
θ
1
,
θ
2
)
T
,
b
=
θ
0
\omega =\left ( \theta _{1} , \theta _{2}\right )^{T} ,b=\theta _{0}
ω=(θ1,θ2)T,b=θ0那么超平面(
ω
T
x
+
b
=
0
\omega ^{T}x+b=0
ωTx+b=0)变为
θ
1
x
1
+
θ
2
x
2
+
θ
0
=
0
\theta _{1}x_{1}+\theta _{2}x_{2}+\theta _{0}=0
θ1x1+θ2x2+θ0=0做一下变形就成为了如下公式:
x
2
=
−
θ
1
θ
2
x
1
−
θ
0
θ
2
x_{2}=-\frac{\theta _{1}}{\theta _{2}}x_{1}-\frac{\theta _{0}}{\theta _{2}}
x2=−θ2θ1x1−θ2θ0而$\omega $ 的斜率为
θ
2
θ
1
\frac{\theta _{2}}{\theta _{1}}
θ1θ2, 因而$\omega
和
超
平
面
的
斜
率
相
乘
为
−
1
,
即
和超平面的斜率相乘为-1, 即
和超平面的斜率相乘为−1,即\omega $ 和超平面垂直了。