安装libsvm工具包
来源:互联网 发布:网易云课堂网络 编辑:程序博客网 时间:2024/06/07 01:23
安装libsvm工具包步骤
一、进入官网主页下载工具包:
http://www.csie.ntu.edu.tw/~cjlin/libsvm/
二、解压文件,生成一个文件夹,我的是libsvm-3.21
三、设置路径,将libsvm-3.21文件夹添加到matlab搜索路径上。
左上角File->Set Path->Add Folder->选中第二部解压生成的文件夹->Save
四、将Current Folder的路径指向第二部生成的文件夹:E:\libsvm-3.21\matlab\(我将工具包解压到了E盘的libsvm-3.21文件夹,实际操作时指向这个文件就可以了)
五、编译
再Matlab命令行输入mex -setup(注意中间的空格),出现如下提示:
mex -setupPlease choose your compiler for building external interface (MEX) files: Would you like mex to locate installed compilers [y]/n? y Select a compiler: [1] Microsoft Visual C++ 2010 in C:\Program Files (x86)\Microsoft Visual Studio 10.0 [0] None
然后选择编译器:我电脑里只有这一个,所以就选择1。出现下面提示:让确认选择的编译器是否正确,如果正确就输入y
Compiler: 1 Please verify your choices: Compiler: Microsoft Visual C++ 2010 Location: C:\Program Files (x86)\Microsoft Visual Studio 10.0 Are these correct [y]/n?
输入y之后,出现如下提示:
Are these correct [y]/n? y *************************************************************************** Warning: MEX-files generated using Microsoft Visual C++ 2010 require that Microsoft Visual Studio 2010 run-time libraries be available on the computer they are run on. If you plan to redistribute your MEX-files to other MATLAB users, be sure that they have the run-time libraries. *************************************************************************** Trying to update options file: C:\Users\wangxuewei\AppData\Roaming\MathWorks\MATLAB\R2010b\mexopts.bat From template: C:\PROGRA~1\MATLAB\R2010b\bin\win64\mexopts\msvc100opts.bat Done . . .
六、make
在命令窗口输入:make
make如果成功了,会发现在Current Folder窗口中会多出四个后缀为.mexw64文件,这是编译后生成的。
七、测试
>> [label_vector, instance_matrix] = libsvmread('E:\libsvm-3.21\heart_scale');>> model=svmtrain(label_vector,instance_matrix);
其中 libsvmread('filename');是导入测试数据,在解压生成的文件夹libsvm-3.21,有一个名为heart_scale的文件,这里面包含测试数据,所以filename用指向heart_scale的路径代替就好。如果安装正确,运行结果如下:
*optimization finished, #iter = 162nu = 0.431029obj = -100.877288, rho = 0.424462nSV = 132, nBSV = 107Total nSV = 132
参考博客:http://blog.sciencenet.cn/blog-261330-627680.html
0 0
- 安装libsvm工具包
- Matlab中libsvm工具包的安装
- LIBSVM安装
- libsvm安装
- libsvm安装
- libsvm 安装
- libsvm安装
- matlab和python中引用libsvm工具包
- 使用Libsvm工具包实现人脸分类
- svm理论与实验之11:svm开发工具包LibSVM
- libsvm工具包学习使用的一个好博客
- 理解支持向量机(四)LibSVM工具包的使用
- 【机器学习实战07】SVM--LibSVM工具包的使用
- matlab二分类实验(使用libsvm工具包+SVMcgForClass函数)
- 囧~安装libsvm
- Matlab安装使用libsvm
- LibSVM安装的问题
- Matlab 安装libsvm 教程
- 拆解Clucene 系列(1)---Clucene的特点和难点
- POJ 3083--Children of the Candy Corn
- 每天一个linux命令(8):cp 命令
- 结构体字节对齐问题
- Android Robotium测试框架
- 安装libsvm工具包
- chrome跨域访问
- 每天一个linux命令(9):touch 命令
- linux简介
- java输出执行开始时间,结束时间和运行时间
- Android - 线程同步
- git学习
- Android初级教程:使用xml序列器
- Go起步:2、Go指南,编辑器--Visual Studio Code和LiteIDE