Thursday 8 December 2011

SVM Train the Data in Matlab | Matlab SVM code for training and Testing | Matlab svm data train and test

In Support Vector machine uses predict the supervised learning data's.In beginning SVM uses two class features only.Now we modifies that algorithm used more class data's in Muti-SVM concept.It supports following type of functions run inside the SVM.
  1. Linear data's
  2. Quadratic data's
  3. Radial Basis Function data's
  4. Multi-layer Perception data's
These above are developed kernel function's.These are predefined develop codes in matlab.In below mention SVM main properties.
  1. Input (Training data's) .
  2. Output(Groups).
  3. Kernel functions.
In svm use more domain's to analyse the datas's and predict the patterns.It used most major domain's like Data-mining,image processing,medical Imaging and ect.Below we give some example code for SVM Example.It use svmtrain and svmclassify function's.
  1. svmtrain for train the data's.
  2. svmclassify for test the data's.
below example contain two classes of 9 data's.
>> data = [1 1;2 1;3 1;4 1;5 2;6 2;7 2;8 2;9 2];
>> data

data =

1 1
2 1
3 1
4 1
5 2
6 2
7 2
8 2
9 2

>> my_svm_struct = svmtrain(data(:,1),data(:,2));
>> out = svmclassify(my_svm_struct,1)

out =

1

>> out = svmclassify(my_svm_struct,1.5)

out =

1

Finally predict the data's using svmclassify function.

Kindly Bookmark and Share it:

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...