matlab - 如何在 MATLAB 上开始 SVM 训练

标签 matlab machine-learning svm libsvm

我已经获得了一组面部特征,并希望使用 SVM 进行分类。我打算使用libsvm包并使用MATLAB来进行训练。我已经通过观看斯坦福讲座了解了SVM。但我不确定如何使用 libsvm 启动..需要一些指导...

最佳答案

在 matlab 中,您可以将 matlab 代码与一些用 c 实现的程序链接起来。这称为mex-file .

但是您需要编译它们才能使其工作。

您可以阅读自述文件以了解如何编译它们:

Installation

On Unix systems, we recommend using GNU g++ as your compiler and type 'make' to build 'svmtrain.mexglx' and 'svmpredict.mexglx'. Note that we assume your MATLAB is installed in '/usr/local/matlab', if not, please change MATLABDIR in Makefile.

Example: linux> make

To use Octave, type 'make octave':

Example: linux> make octave

On Windows systems, pre-built binary files are already in the directory `..\windows', so no need to conduct installation. Now we include both 32bit binary files and 64bit binary files, but in future releases, we will provide binary files only for 64bit MATLAB on Windows. If you have modified the sources and would like to re-build the package, type 'mex -setup' in MATLAB to choose a compiler for mex first. Then type 'make' to start the installation.

Example:

    matlab> mex -setup

(ps: MATLAB will show the following messages to setup default compiler.) Please 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/C++ version 7.1 in C:\Program Files\Microsoft Visual Studio [0] None Compiler: 1 Please verify your choices: Compiler: Microsoft Visual C/C++ 7.1 Location: C:\Program Files\Microsoft Visual Studio Are these correct?([y]/n): y

    matlab> make

For list of supported/compatible compilers for MATLAB, please check the following page:

http://www.mathworks.com/support/compilers/current_release/

关于matlab - 如何在 MATLAB 上开始 SVM 训练,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8567950/

相关文章:

matlab - 在 MATLAB 中验证输入的最佳实践

MATLAB:不使用现有函数的 10 折交叉验证

machine-learning - 激活函数的导数与偏导数。损失函数

amazon-web-services - 在 AWS 机器学习中创建数据源

python - 找到 C 和 gamma 的值以优化 SVM

java - 在 Matlab 中将 java.util.HashMap 键转换为 vector

matlab - 在 MATLAB 子图中设置 XTick?

python - 如何将个人PNG数据集放入Sci-Kit Learn中进行图像识别?

matlab - 在 Matlab 中使用 svmtrain 内存不足

python - python 中使用 SVM 进行机器学习的分类报告测试集出错