Info

This question is closed. Reopen it to edit or answer.

Support Vector Machine. Help please.

1 view (last 30 days)
Pramod Bhat
Pramod Bhat on 28 Mar 2012
Closed: MATLAB Answer Bot on 20 Aug 2021
*Hai...I wanted to use SVM classifier code given in MATLAB. The problem is that the classifier is not giving correct classification even if i use some of the same training data as test data. What is the problem here ? Please help. thanks in advance. * load data %the features are saved in tha data file 'data'. close all
clc
load data %the features are saved in tha data file 'data'. 'matrix' is a matrix containing 7 columns(7 features). There are 38 observations( that means 38 rows).
data = [matrix(:,1), matrix(:,2)];%selects 1st and 2nd column as training data.
svmStruct = svmtrain(data,species,'Showplot',true);
%test=[matrix(:,3),matrix(:,)];
test=[ 0.0113 0.2382 ] % one of the elements of the training data used as test data.
classes = svmclassify(svmStruct,test)

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!