How to set up LIBSVM Matlab interface?

前端 未结 3 1458
南旧
南旧 2021-01-05 18:37

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 packag

3条回答
  •  悲哀的现实
    2021-01-05 19:10

    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.

    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).

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

    cd ROOT
    cd matlab
    make
    

    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).

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

    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).

    Then, by typing:

    svmtrain
    

    and

    svmpredict
    

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

提交回复
热议问题