如何设置LIBSVM Matlab接口? [英] How to set up LIBSVM Matlab interface?

查看:61
本文介绍了如何设置LIBSVM Matlab接口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在将LibSVM实施到MATLAB时遇到问题. 我正在使用MATLAB R2009a(我也有最新版本,R2012b,但我没有使用那个版本) 我将LibSVM软件包libsvm-3.14下载到Windows 7 PC上,该软件包与MATLAB和OCTAVE界面结合在一起.

I am having problem with implementing LibSVM to MATLAB. I am using MATLAB R2009a (I also have the latest version, R2012b, but I dont use that one) I downloaded LibSVM package, libsvm-3.14 to my Windows 7 PC, which MATLAB and OCTAVE interface come together.

我解压缩了我下载的文件夹.在下面,您可以在其中看到文件夹所在位置的打印屏幕.

I extracted the folder I downloaded. Which, below, you can see the printscreen of what the folder has in.

我应该将libsvm-3.14提取的文件夹放在哪里?是否应该将其放在安装在目录中的MATLAB的"bin"文件夹下?

Where should I put my libsvm-3.14 extracted folder ? Should I put it under "bin" folder of my MATLAB installed in the directory?

C:\ Program Files \ MATLAB \ R2009a \ bin

C:\Program Files\MATLAB\R2009a\bin

我这样做了,但是没有成功.如果您能帮助我,我将不胜感激.我只是读了README文件,但不清楚并不清楚,互联网上也没有在线其他说明.

I did that, however, it didn't work out. I will be grateful if you help me clearly. I just read README file, but it's not clear to understand and there is no other instructions online on the internet.

推荐答案

目前,将文件夹放在何处都没有关系.您必须从提取的libsvm软件包的 matlab 子文件夹中的源代码编译Matlab-MEX文件.

For the time being, it does not matter where you put that folder. You'll have to compile the Matlab-MEX files, from the source code that resides in the matlab subfolder of your extracted libsvm package.

下面,我将调用libsvm-3.14(例如:C:\ libsvm-3.14)提取的文件夹ROOT(因此,请替换下面的C:\ libsvm-3.14的ROOT).

Below, I will call the libsvm-3.14 (for example: C:\libsvm-3.14) extracted folder ROOT (so replace ROOT wilth C:\libsvm-3.14 below).

因此,启动Matlab,然后在其命令提示符下键入:

So, fire up Matlab and, then, at its command prompt, type:

cd ROOT
cd matlab
make

现在,在ROOT/matlab文件夹中,您应该已经获得了两个MEX文件(扩展名为.mexw32或.mexw64).这些是您从现在开始将使用的文件.您可以丢弃其余的文件,除了那些文件(也许还有一些其他生成的库).

Now, in the ROOT/matlab folder, you should have obtained two MEX files (with the .mexw32 or .mexw64 extension). These are the files that you will use from now on. You can discard the rest, except those files (and, maybe, some other generated libraries).

根据Makefile(即ROOT/matlab/make.m),MEX文件称为svmtrain和svmpredic(带有扩展名).

According to the Makefile (that is ROOT/matlab/make.m), the MEX files are called svmtrain and svmpredic (+ the extension).

因此,下一步是在您的Matlab/toolbox文件夹下创建一个名为libsvm/的子文件夹,复制其中的两个MEX文件,然后将该libsvm/文件夹添加到Matlab路径(而不是系统路径,但安装了Matlab.

So, next step would be to create a subfolder called libsvm/ under your's Matlab/toolbox folder, copy the two MEX files therein and, then, add that libsvm/ folder to the Matlab Path (not the Path of your system, but of your Matlab installation).

然后,通过键入:

svmtrain

svmpredict

您应该获得这两个功能的帮助(使用).

you should have the help (usage) of these two functions.

这篇关于如何设置LIBSVM Matlab接口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆