Skip to content

Mahtab-Shabani/Neural-Network-SVM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Neural-Network-SVM

Input data:

load fisheriris     % Load data
data = meas(1:100,1:2);
group = species(1:100); % lable of classes

Fisher's iris data consists of measurements on the sepal length, sepal width, petal length, and petal width for 150 iris specimens. There are 50 specimens from each of three species.

Train network:

svmStruct = svmtrain(data,group,'showplot',true); % train network

Crossvalidation:

[train, test] = crossvalind('holdOut',group);
cp = classperf(group);

Test network:

classes= svmclassify(svmStruct,data(test,:),'showplot',false);

Evaluate performance of classifier:

classperf(cp,classes,test);
CorrectRate=cp.CorrectRate;
ErrorRate=cp.ErrorRate;

Linear classification:

image

Non-linear classification using RBF kernel: image

Non-linear classification using quadratic kernel:

image