In this environment, the installation of LIBSVM can be said to be a fool, but in my search for the LIBSVM installation tutorial, the previous LIBSVM installation is a bit of trouble
The latest version is LIBSVM 3.18, according to the description of [1], put LIBSVM's Windows directory into the MATLAB directory, I think blogger said this directory should not be the current working directory of MATLAB, but the search directory of MATLAB. Because the current working directory has only one, you set it to Windows, then the LIBSVM directory of the Heart_scale dataset can not directly load in (need to set the path), about the MATLAB search directory and the current directory of more knowledge can refer to [2]
The Windows directory joins the MATLAB 2013 search path to do this:
1. Place the LIBSVM directory in the current working directory
2. Locate the Windows directory under the current working directory and right-click Add to Path
Then, the configuration is over, LIBSVM 3.18 has no C + + dataset, the MATLAB dataset differs from [3], and the direct load data.
Test code [1]
[Heart_scale_label,heart_scale_inst]=libsvmread (' Heart_scale ');
Model = Svmtrain (Heart_scale_label,heart_scale_inst, '-C 1-g 0.07 ');
[Predict_label, accuracy, dec_values] =svmpredict (Heart_scale_label, heart_scale_inst, model); % test the Trainingdata
You will see the result:
accuracy = 86.6667% (234/270) (classification)
Reference
[1] http://blog.csdn.net/lqhbupt/article/details/8596349
[2] Http://www.matlabsky.com/thread-11925-1-1.html
[3] http://blog.csdn.net/abcjennifer/article/details/7370177