Machine Learning by Andrew Ng --- Support Vector Machine

本文介绍了支持向量机(SVM)的基本原理及应用实践。通过实际练习加深了对SVM的理解,并探讨了如何选择参数C和sigma。此外,还讨论了使用SVM进行电子邮件垃圾邮件分类的过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Aha, after the intricate BP neural network(I spend more than 24 hours to finish that exercise,but even i finish ,i am sure i am not understand BP neural network well),now i finally meet the powerful SVM algorithm .


   As my idol -- Andrew Ng said,There are lots of package of SVM algorithm , It is no need to write a SVM algorithm by yourself,One thing U should do is that understanding the basic principle of SVM,and kown how to use it.


So, let's do this.

Here are my exercise's answer,Do not copy it! finish it by yourself!

 

I am not sure with my selet of C and sigma,I have print 11 figures which C and sigma make mean equal to 0,after that , I look at the 11 figures and choose the best answer of C and sigma, I think there are many better ways.

   

When using SVM,just think SVM as a logistic algorithm,U got X and Y,U do not need to add interrupt term,all U need to is passing X and y to your SVM algorithm,after svmTrain (U also should pick some other parameters),U got model(I am not sure about what model exactly is).Then using svmPredict to test or apply it to real work.

The part 2 of ex2 is email spam,just few things different from part 1.U should first Preprocessing Emails,then selet the word which appeared in vocabList,And recording the indicates of the word.Finally each email will be a vector (1988 features).Next U should do is like Part 1(U can not plot it since there are 1988 feature in any examples of part 2).

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值