Andrew Ng 's machine learning lecture note (13)

Support vector machine(SVM)

(1) The cost function of SVM is 

(2)The hypothesis is 

(3)The decision boundary has a large margin which means the boundary is far from the data points.


Concretely,our hypothesis and f will be in the following 2 ways:

Gaussian kernel

 

f(1) will always be 1, then we can use the algorithm to learn the theta.
Pay attention! f has the same dimension as the number of training examples.

Linear kernel(without the kernel)


Conclusion, well now we have so many models, which model is better? 
We can make the decision based on the number of features n and the number of training examples m.

If n is small, m is intermediate(n = 1-1000, m = 1-10000) .SVM with the gaussian if n is small, m is large(n = 1- 1000, m =1-10000) we should add more features, we can use logistic regression or SVM without the kernel.If n is large (relative to m), then we'd better use logistic regression or SVM.

One VS all in SVM


The one VS all algorithm is the same as the one vs all algorithm mentioned in logistic regression. Suppose that we have k classes and we have to train k sets of theta. we have k outputs while we have a input , we choose the largest output as our output to 1 the other outputs become 0. 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值