Info

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

How to train using SVM?

1 view (last 30 days)
Ampi
Ampi on 5 Dec 2012
Hello,
I am attaching a code below for training using SVM for Faces.
I am proceeding in the following way:-
In training matrix i have taken 2 rows each row has 4 samples of a individual. Now i have fixed the target matrix at:-
labelData(1:4,:) = 1;
labelData(5:8,:) = 2;
Now i am training the data as follows:-
svmModel = svmtrain(arr1', labelData, ...'Autoscale',true, 'Showplot',true, 'Method','QP', ...'BoxConstraint',2e-1, 'Kernel_Function','rbf', RBF_Sigma',1); classes = svmclassify(svmModel,finaltest,'showplot','true') cp = classperf(cp, classes, finaltest')
The final list of features given are:-
arr1 =
0.1058 -0.5517 -1.3537 62.4660 119.9515 138.0683 137.9539 127.3512 120.5434 95.0995
-252.4978 -6.1384 -6.5467 -1.4940 31.6996 89.8276 118.6320 120.7114 86.2801 42.4085
-541.0102 -129.8960 -128.3588 -136.9744 -105.7236 -64.3677 -10.4804 30.5314 45.8545 22.7236
-541.0102 -250.1544 -128.3588 -139.1115 -107.8966 -87.0327 -10.4804 30.5314 45.8545 22.7236
-542.6045 -545.1539 -139.5034 -139.1115 -139.8038 -87.0327 -39.0280 -28.4102 -20.8262 -33.8483
-542.6045 -545.1539 -154.1400 -145.5581 -139.8038 -98.5822 -75.3121 -35.7535 -20.8262 -33.8483
-546.0365 -548.3869 -154.1400 -169.4303 -170.3015 -123.2716 -75.3121 -35.7535 -37.6052 -63.0706
-546.3883 -548.3869 -208.0748 -169.4303 -170.3015 -123.2716 -110.6051 -137.7718 -163.2197 -203.0798
My question is how to obtain the classification plot of SVM for plotting these vectors as I am not getting any plot? Any help would be highly appreciated.

Answers (0)

Community Treasure Hunt

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

Start Hunting!