《量化投资:以MATLAB为工具》

MATLAB技术论坛

 找回密码
 注册账号
查看: 498252|回复: 3133
收起左侧

[教程] 关于SVM的那点破事[faruto长期更新整理]

    [复制链接]
发表于 2010-11-2 14:11:00 | 显示全部楼层 |阅读模式
本帖最后由 faruto 于 2011-7-16 15:14 编辑

关于SVM的那点破事[faruto长期更新整理]


简易目录:

写在前面的碎碎念;
Libsvm下载
SVM入门;
Libsvm安装与使用(待完善);
SVM相关文献资料;
SVM相关书籍推荐;
SVM[Libsvm]相关应用(待完善);
SVM相关杂帖(待完善);
写在最后的闲扯淡;
Faruto的联系方式(讨论MATLAB相关问题或者具体一些SVM相关问题或者再具体一些libsvm使用相关问题或者再再具体一些 … …);

===================无聊的分隔线=========================

写在前面的碎碎念 by faruto        

        还记得初次接触SVM是本科大三的时候参加北师本科科研基金在管理学院系统科学那边做一个有关脑电波EEG模式识别的项目,那时候对于“机器学习”这个概念还是头一次染指,后来使用libsvm工具箱来做分类和回归,在用的过程中来学习SVM底层的统计学习理论,再后来自己完善提升libsvm的matlab版本,在林智仁先生的libsvm-mat基础上自己编写了一些辅助函数(参数寻优什么的),后来不断完善,最终自己的libsvm-mat版本是libsvm-mat-2.89-3[FarutoUltimate3.0],方便自己使用以及论坛的一些朋友使用。
        SVM的实现工具箱有很多,但我还是认为libsvm最好用(lssvm也不错的说),我认为把这一个SVM的实现工具箱研究的透彻就够了,反正我是够用了,即如果现在需要SVM这个工具来进行分类或者回归我可以拿来libsvm-mat-2.89-3[FarutoUltimate3.0]就能熟练使用以达到解决自己的问题的目的,而不用再重新学习掌握SVM这个工具。
        其实还有一些话要说,姑且先留着吧 … …

====================
MATLAB技术论坛电子期刊第九期(2011.06)[faruto帖子集锦]
http://www.matlabsky.com/thread-17223-1-1.html
====================
《Learn SVM Step by Step 》系列视频应用篇
Libsvm的下载、安装和使用
http://www.matlabsky.com/thread-18080-1-1.html

Libsvm参数实例详解
http://www.matlabsky.com/thread-18457-1-1.html

一个实例搞定libsvm分类
http://www.matlabsky.com/thread-18521-1-1.html

一个实例搞定libsvm回归
http://www.matlabsky.com/thread-18552-1-1.html
Libsvm下载

Libsvm-mat林智仁先生的原始版本下载

libsvm官方更新[2011.04.01]:libsvm-3.1
http://www.matlabsky.com/thread-14345-1-1.html

libsvm-mat-2.91-1.zip
http://www.matlabsky.com/thread-9328-1-1.html
【说明:最新的版本为libsvm-mat-3.0-1.zip大家可以在这里下载http://www.csie.ntu.edu.tw/~cjlin/libsvm/ 最新版本的改动是将SVM的model structure移动到了svm.h里面,对于常规用户没有影响基本和以前的都一样,只是方便一些高级用户自己进行底层代码的修改】

Libsvm-mat faruto版本下载

(更新libsvm-faruto版本归来)libsvm-3.1-[FarutoUltimate3.1Mcode]
http://www.matlabsky.com/thread-17936-1-1.html

libsvm-mat-2.89-3[FarutoUltimate3.0]
http://www.matlabsky.com/thread-9327-1-1.html

GUI版本下载【基于libsvm-mat-2.89-3[FarutoUltimate3.0]】
[原创]SVM_GUI_2.0[mcode][by_faruto]
http://www.matlabsky.com/thread-9333-1-1.html

SVM入门

我个人推荐您看这个系列帖子

SVM入门精品系列讲解目录
http://www.matlabsky.com/thread-10317-1-1.html
共有10个系列讲解,很适合SVM入门。

[整理]Libsvm官方FAQ翻译
http://www.matlabsky.com/thread-15225-1-1.html


Libsvm安装与使用(待完善);

libsvm-mat在MATLAB平台下的安装【by faruto】
http://www.matlabsky.com/thread-11925-1-1.html

如何使用libsvm进行分类【by faruto】
http://www.matlabsky.com/thread-12379-1-1.html

如何使用libsvm进行回归预测【by faruto】
http://www.matlabsky.com/thread-12390-1-1.html

利用libsvm-mat建立分类模型model参数解密【by faruto】
http://www.matlabsky.com/thread-12649-1-1.html

libsvm如何使用自定义核函数[有关-t 4 参数的使用例子]
http://www.matlabsky.com/thread-15296-1-1.html

【转】Matlab中使用libsvm进行分类预测时的标签问题再次说明
http://www.matlabsky.com/thread-12396-1-1.html

基于GridSearch的svm参数寻优
http://www.matlabsky.com/thread-12411-1-1.html

基于GA的svm参数寻优
http://www.matlabsky.com/thread-12412-1-1.html

基于PSO的svm参数寻优
http://www.matlabsky.com/thread-12414-1-1.html

线性可分模式的最优超平面的详细推导过程【支持向量机相关】
http://www.matlabsky.com/thread-12613-1-1.html


libsvm 参数说明【中英文双语版本】
http://www.matlabsky.com/thread-12380-1-1.html


这部分过一段还要完善,目前关于libsvm的安装与使用可以参看以下资源


另外一篇:MATLAB自带的svm实现函数与libsvm差别小议

1 MATLAB自带的svm实现函数仅有的模型是C-SVC(C-support vector classification); 而libsvm工具箱有C-SVC(C-support vector classification),nu-SVC(nu-support vector classification),one-class SVM(distribution estimation),epsilon-SVR(epsilon-support vector regression),nu-SVR(nu-support vector regression)等多种模型可供使用。
2 MATLAB自带的svm实现函数仅支持分类问题,不支持回归问题;而libsvm不仅支持分类问题,亦支持回归问题。
3 MATLAB自带的svm实现函数仅支持二分类问题,多分类问题需按照多分类的相应算法编程实现;而libsvm采用1v1算法支持多分类。
4 MATLAB自带的svm实现函数采用RBF核函数时无法调节核函数的参数gamma,貌似仅能用默认的;而libsvm可以进行该参数的调节。
5 libsvm中的二次规划问题的解决算法是SMO;而MATLAB自带的svm实现函数中二次规划问题的解法有三种可以选择:经典二次方法;SMO;最小二乘。(这个是我目前发现的MATLAB自带的svm实现函数唯一的优点~)

参看在优酷上的一个有关libsvm的视频(这个是我以前在国内某论坛制作过的一个视频被网友放到了优酷上)

http://v.youku.com/v_show/id_XMTIwOTIzNTQ4.html

SVM相关文献资料

[flash]
http://player.youku.com/player.php/sid/XMTIwOTIzNTQ4/v.swf
[/flash]


关于SVM的理论相关的,在下面提供了一些资源和paper, ppt,pdf,虽然这几个资源是有限的,但我敢说足够了.原因有两个:a.下面的几个文献本身质量就很高.b.这些文献主要的SVM的参考文献已经几乎全部列出了,你可以寻径查找.

田英杰_支持向量回归机及其应用研究
http://www.matlabsky.com/thread-12841-1-1.html

Sequential Minimal Optimization for SVM
http://www.matlabsky.com/thread-13059-1-1.html


资料截图: 1.jpg

资料打包下载:
SVM相关文献资料.rar (1.72 MB, 下载次数: 165047)

评分

参与人数 11威望 +15 贝壳 +20 贡献 +6 收起 理由
国家佳 + 1 + 1 楼主整理的太辛苦了,我很有收获啊
sarathy + 1 + 1
ylhshadpw + 1 + 1
mlzy_byr + 1 + 1 好银啊
fengchuizhuming + 1 支持原创内容,鼓励自己动手

查看全部评分

发表于 2015-7-24 14:34:45 | 显示全部楼层
faruto 发表于 2010-11-3 08:11
真本书原本就没有配套光盘的。O(∩_∩)O

视频是额外购买的。~

楼主您好,我看了您的书,有个地方不太明白,还望您解释一下。cmd = ['-v ',num2str(pso_option.v),' -c ',num2str( pop(i,1) ),' -g ',num2str( pop(i,2) ),' -s 3 -p 0.01'];
    fitness(i) = svmtrain(train_label, train, cmd);
"分类问题适应度函数用的是cv下的分类准确率,回归问题适应度函数用的是cv下的mse",fitness(i) 都能反映吗,fitness(i) 不是交叉验证的分类准确率吗,怎么可以反映回归平方相关系数或回归误差(mse)。这样做会不会使回归参数的优化的带来较大的误差
回复 支持 1 反对 0

使用道具 举报

发表于 2018-6-23 22:19:28 | 显示全部楼层

holesale NFL Jerseys

Mauer had three hits in the first three innings, Trevor Plouffe's two-run double highlighted a four-run first inning and Escobar's homer landed in the second deck in left field to give Minnesota a 7-0 lead in the fourth.
UP NEXT
The Tigers (65-78) are 19 games behind AL Central-leading Kansas City.
The Vikings opened the season with a late game in San Francisco, and the announced crowd at Target Field of 17,833 was the second-lowest of the season for the Twins, who had not been under 25,000 for a home game since July 6.
"It's like taking a punch to the gut early, I mean you hope something sparks you along the way,Cheap Jerseys 2018," Tigers manager Brad Ausmus said. "We had some good at-bats,Authentic Jerseys China, we had some opportunities. We had some guys in scoring position, but we didn't really capitalize in terms of scoring runs."
VIKINGS FEVER
Phil Hughes (10-8, 4.49) will start for the Twins against Alfredo Simon (12-9, 4.94). Hughes will be pitching for the first time since Aug. 9 due to a back injury. Simon is coming off a rough no decision outing in which he allowed five runs on nine hits — including a pair of home runs — in 6 2-3 innings against Cleveland.
Even though the Twins are back in the playoff race for the first time since 2010, it was clear on Monday night that it's still a Vikings town.
It was another mess for the Tigers, with Martinez misplaying Plouffe's opposite field shot off the wall in right, Lobstein getting hit hard and being charged with a balk all in the first inning. The Twins sent 17 hitters to the plate in the first two innings.
It's unclear how much longer the 24-year-old will be pitching, so he's going to enjoy the ride while it lasts.
TRAINER'S ROOM
It's been quite a reversal of fortunes for these two teams, with the once-mighty Tigers bottoming out this season and the Twins (75-68) — losers of at least 90 games in each of the past four seasons — vaulting back into the postseason picture.
"They haven't been overly intimidated by road games or hostile crowds or adversity or tough losses," manager Paul Molitor said. "They've found a way to bounce back."
"I had no idea where I'd end up this year,Wholesale NHL Jerseys," said Duffey,Cheap Stitched Jerseys, who was pitching for the first time in a week with the Twins trying to limit his innings. "I was just hoping to be in Triple-A and finish strong there. I'm getting the opportunity to pitch in some really meaningful games. That's all you can ask for."
Torii Hunter had two hits and an RBI for Minnesota,Cheap NFL Jerseys China.
Duffey (3-1) gave up one run on seven hits and walked two in 6 1-3 innings,China Jerseys Wholesale, and Joe Mauer went 3 for 5, extending his streak of games reaching base to 34 for the Twins, who trail the Texas Rangers by one game for the American League's second wild card.
MINNEAPOLIS (AP) — Tyler Duffey wasn't around for the Minnesota Twins' struggles of the previous four years. And he wasn't expecting to be around for their resurgence this season.
The Twins returned home from a 10-day road trip pretty much right where they left off — neck-and-neck with the Rangers for the second wild-card spot. They play 13 of their final 20 games at home, including 10 in a row against the Tigers, Angels and Indians.
Playing their first meaningful September games in five years, the Twins jumped on Lobstein and the Tigers right off the bat.
Twins: All-Star closer Glen Perkins threw a bullpen session on Monday to test his ailing back. He said everything went well and he will throw another bullpen on Wednesday. If all goes well then, Perkins said he hoped to be ready to return to action by Friday. He has not pitched since Sept. 1.
Kyle Lobstein (3-8) gave up six runs on seven hits in just 1 2-3 innings for the Tigers. J.D. Martinez had two hits for Detroit, but Steven Moya had four of the team's 11 strikeouts.
Tigers: Anibal Sanchez said after the game he would not make a start on Wednesday as initially planned. Sanchez said his shoulder flared up again and he now plans to see a specialist, perhaps Dr. James Andrews.
Duffey struck out seven while pitching into the seventh inning and Eduardo Escobar homered and drove in two runs to lead the Twins to a 7-1 victory over the Detroit Tigers on Monday night.
回复 支持 反对

使用道具 举报

发表于 2010-11-2 18:45:33 | 显示全部楼层
这帖子相当给力。不能不赞。另外,再发一问。
洋兄,能不能通过内部权值和阈值以及传递函数把已经训练好的网络用表达式写出来?
发表于 2010-11-2 20:47:24 | 显示全部楼层
东西都很经典,收藏了,慢慢品味
发表于 2010-11-2 20:58:40 | 显示全部楼层
楼主在吗?看了你写的那本书,我很想买,请问在卓越买有送光盘吗??我似乎没看到呢
发表于 2010-11-2 21:38:29 | 显示全部楼层
楼主太厉害了!楼主,I服U!
我觉得MATLAB技术论坛是注册对了!
发表于 2010-11-2 21:53:49 | 显示全部楼层
很期待《MATLAB 神经网络30个案例分析》第二版的发布啊!第一版里面的错误真的不少,特别是里面印的代码和从论坛上下载的相同M文件里面代码出入都挺大的。如果直接按照书上面的代码手动输入的话程序运行时经常报错,还是有待完善和提高啊
 楼主| 发表于 2010-11-3 08:11:59 | 显示全部楼层
yanwen 发表于 2010-11-2 20:58
楼主在吗?看了你写的那本书,我很想买,请问在卓越买有送光盘吗??我似乎没看到呢

真本书原本就没有配套光盘的。O(∩_∩)O

视频是额外购买的。~   

 楼主| 发表于 2010-11-3 08:12:35 | 显示全部楼层
 楼主| 发表于 2010-11-3 08:16:10 | 显示全部楼层
hyo 发表于 2010-11-2 18:45
这帖子相当给力。不能不赞。另外,再发一问。
洋兄,能不能通过内部权值和阈值以及传递函数把已经训练好的 ...

这个完全是可以的~

具体的表达式是可以写出来的~
发表于 2010-11-3 08:47:49 | 显示全部楼层
回复 faruto 的帖子

你有没有做过这个方面的例子,给我膜拜一下。
您需要登录后才可以回帖 登录 | 注册账号

本版积分规则

QQ|网站地图|MATLAB技术论坛|Simulink仿真论坛 ( 陕ICP备08102094号 

GMT+8, 2018-8-18 08:44 , Processed in 0.245771 second(s), 20 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表