File Exchange

image thumbnail

Multi Class SVM

version 1.2.0.0 (9.71 KB) by Abbas Manthiri S
Multi class SVM developed by using binary svm classification

48 Downloads

Updated 08 Apr 2017

View License

It classify multi Class Instance SVM Click on demo to view code proof ..
this also accept all option as varargin no need about worry
It is work perfect I Classify using following referece
Multiclass SVM
Multiclass SVM aims to assign labels to instances by using support vector machines, where the labels are drawn from a finite set of several elements.
The dominant approach for doing so is to reduce the single multiclass problem into multiple binary classification problems.[17] Common methods for such reduction include:[17][18]

Building binary classifiers which distinguish (i) between one of the labels and the rest (one-versus-all) or (ii) between every pair of classes (one-versus-one). Classification of new instances for the one-versus-all case is done by a winner-takes-all strategy, in which the classifier with the highest output function assigns the class (it is important that the output functions be calibrated to produce comparable scores). For the one-versus-one approach, classification is done by a max-wins voting strategy, in which every classifier assigns the instance to one of the two classes, then the vote for the assigned class is increased by one vote, and finally the class with the most votes determines the instance classification.

URL;https://en.wikipedia.org/wiki/Support_vector_machine

Cite As

Abbas Manthiri S (2020). Multi Class SVM (https://www.mathworks.com/matlabcentral/fileexchange/62061-multi-class-svm), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (27)

doesn't work.
model{i}=svmtrain(training,classx,varargin{:});

Hi there, it worked perfectly. I just want to know if we can input a different decision threshold for the boundary to test the functionality

The first input should be a struct generated by SVMTRAIN.

is this svm the One versus One or One versus All?

Kinto Wan

@Newbiggin I think it's OVA

Thanks for sharing your codes. By the way, how do I plot the multi classifiers?

Newbiggin

Hi
This worked perfectly fine.
Just wanted to know is this OVA or OVO.

I downloaded the file and unzip it. After running the Demo.m file, I am getting this error.
Error using svm.svmclassify (line 337)
The first input should be a struct generated by SVMTRAIN.

Error in svm.predict (line 315)
[~,threshold]=svm.svmclassify(model{i},sample,varargin{:});

Error in demo (line 14)
predict=svm.predict(Model,Sample);

fengjie wu

I downloaded the file and unzip it. After running the Demo.m file, I am getting this error.

Reference to non-existent field 'SupportVectors'.

Error in svm.svmclassify (line 344)
if size(sample,2)~=size(svmStruct.SupportVectors,2)
Error in svm.predict (line 315)
[~,threshold]=svm.svmclassify(model{i},sample,varargin{:});
Error in demo (line 15)
predict=svm.predict(Model,Sample);

Can you please help to solve this problem.?

What are the train and test ratio of input sample in this example. Which part of the code tells about train and test data? Please tell.

Ahmad Gafer

Nurhan

Thank you for your code. I tried to run demo.m. It is work well. however it has error if I increase number of samples.

Thank you, but how can I plot this msvm?

@nithya n
i think you are using old version

nithya n

if i run the svm.m file. i am getting this error
classdef svm
Error: Illegal use of reserved keyword "classdef". please clarify me

nithya n

I am getting error in svm.train and svm.classify. please help me to solve this problem

Harivinod N

Harivinod N

I downloaded the file and unzip it. After running the Demo.m file, I am getting this error.

Reference to non-existent field 'SupportVectors'.

Error in svm.svmclassify (line 344)
if size(sample,2)~=size(svmStruct.SupportVectors,2)
Error in svm.predict (line 315)
[~,threshold]=svm.svmclassify(model{i},sample,varargin{:});
Error in demo (line 15)
predict=svm.predict(Model,Sample);

Can you please help to solve this problem.?

Honey Gupta

Please run after unzip

Try to run the example in svm.m but
[Undefined function or variable 'msvmtrain'.]
Is it need the new version matlab?

@Jbhop
you need matlab 2014a

Jbhop

I try to run Demo.m but
Error in svm.svmclassify (line 344)
non SupportVectors field in svmStruct

Updates

1.2.0.0

name changed

1.1.0.0

code updated to class type
simple to call

MATLAB Release Compatibility
Created with R2014a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

msvm/

msvm/html/