机器学习笔记 ---- Support Vector Machines

Support Vector Machines

1. Cost Function

J ( θ ) = C [ ∑ i = 1 m y ( i ) cost 1 ( θ T x ( i ) ) + ( 1 − y ( i ) ) cost 0 ( θ T x ( i ) ) ] + 1 2 ∑ j = 1 n θ j 2 J(\theta)= C \left[\sum_{i=1}^m y^{(i)} \text{cost}_1(\theta^T x^{(i)})+(1-y^{(i)}) \text{cost}_0(\theta^T x^{(i)})\right] + \frac{1}{2}\sum_{j=1}^n\theta^2_j J(θ)=C[i=1my(i)cost1(θTx(i))+(1y(i))cost0(θTx(i))]+21j=1nθj2

2. Hypothesis

f ( x ) = { 1 if  θ T x>=0 0 otherwise f(x)= \begin{cases} 1& \text{if $\theta^T$x>=0}\\ 0& \text{otherwise} \end{cases} f(x)={10if θTx>=0otherwise

3. Margin of SVM


4. Kernels

Define landmarks l l l



Using f f f and θ \theta θ when making predictions…

5. How to Get Landmarks

One way is to use the first m training examples.

6. The Effects of Parameters in SVM

1) For C C C
Large C : λ small, low bias, high variance
Small C : λ big, high bias, low variance
2) For σ 2 \sigma^2 σ2
Large σ 2 \sigma^2 σ2 : high bias, low variance
Small σ 2 \sigma^2 σ2 : low bias, high variance

7. Choice of Kernal

Need to satisfy Mercer’s Theorem.

  1. No kernal (Linear Kernal)
    when n is large/ n is small && m is large
  2. Gaussian Kernal
    when n is small, m is intermediate
    Need to use feature scaling before using!
  3. Other Alternative Choices:
    Polynomial Kernal, String Kernal, Chi-Square Kernal, Intersection Kernal…
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值