Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to use LibSVM toolbox to implement SVM

Shulou Source: shulou.com Published: 2022-06-01 06:59:37 10月26日 Update

This article is about how to use the LibSVM toolbox to achieve SVM, the editor feels very practical, so share with you to learn, I hope you can get something after reading this article, say no more, follow the editor to have a look.

The support vector machine function of the old version of MATLAB is relatively simple, so most of them use LibSVM toolbox to achieve SVM-related functions.

LibSVM is a set of support vector machine library developed by Professor Chih-Jen Lin in Taiwan in 2001, which can easily classify or regression data. Because the libSVM program is small, flexible to use, few input parameters, and is open source, easy to expand.

The library adjusts relatively few parameters involved in SVM, provides a lot of default parameters, which can solve many problems, and provides the function of interactive verification (Cross Validation). The library can solve the problems of C-SVM, v-SVM, ε-SVR and v-SVR, including multi-class pattern recognition based on one-to-one algorithm.

The libsvm-3.1- [FarutoUltimate3.1Mcode] toolbox is improved by faruto on the basis of the libsvm3.1 version. On the basis of the original version, Faruto adds some auxiliary functions to facilitate operation and visualization.

Set Path after download

File- > setpath-> add with subfolders- > the path to join the libsvm folder

Compile in matlab

Purpose: to compile C++ files such as libsvmwrite.c in libsvm\ matlab into matlab files such as libsvmread.mexw64, so that they can be called directly in command window.

Note: the downloaded folder may already contain files such as libsvmread.mexw32 or libsvmread.mexw64. Don't worry about it, this step is still needed.

The compilation method is to type under command window

Mex-setup

Follow the prompts to select the compiler

If prompted that there is no compiler to choose from, you need to install it separately (generally choose Windows SDK). If you encounter problems with the compiler installation, please send "SDK" to get the installation method and notes.

Finally, set the libsvm\ matlab directory as current

Enter under command window

Make

If you can see a string of success, it is a success.

The above is how to use the LibSVM toolbox to achieve SVM. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Tags: Compilers files tools toolkits parameters problems functions versions compilers inputs selections functions vectors foundations that is folders methods more knowledge articles Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Shulou Tech Info Microsoft NVidia Xiaomi