gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-30 08:44:39 25 4
gpt4 key购买 nike

我已经获得了一组面部特征,并希望使用 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com