Libsvm function library instructions

Source: Internet
Author: User
Tags svm

Most of the translations in this article are from Felomeng. The original text is aspx ">Felomeng Translation: Use of libsvm2.88 Library.

The README file of version 2.88 is similar to the README file of libsvm3.0. For the README file of version 3.0, see the following:Http://sdudata.appspot.com/4001-libsvm3.0_README

 

Library Usage=============

These functions and structures are in the header file"Svm. h"Has a reputation. You needC/C ++Add in source file# Include "svm. h"Statement, You need to link your programSvm. cppConnection. For more information, see"Svm-train.cAndSvm-predict.c. In the fileSvm. hUsed inLIBSVM_VERSIONThe version number is defined for readers to check.

 

Before classifying test data, you must use training data to create an SVM model. Models can be stored as files for future use. Once the SVM model is established, it can be used to classify new data.

 

-Function:Struct svm_model * svm_train (const struct svm_problem * prob, const struct svm_parameter * param );

 

This function is constructed based on the given parameters and training data and returns an SVM model.

 

StructSvm_problemFormalizing the problem:

Struct svm_problem

{

Int l;

Double * y;

Struct svm_node ** x;

};

 

"L"Indicates the number of instances of the training data, and"Y"Is an array used to store their target values. (The type value uses integer data, and the regression value uses real numbers)"XIs an array pointer, each Pointer Points to a sparse training vector (that is,Svm_nodeArray ).

 

For example, if we have the following training data:

 

LABELATTR1ATTR2ATTR3ATTR4ATTR5

----- ----- ----- ----- ----- -----

& Nbs

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.