Furkan Gözükara
Furkan Gözükara

Reputation: 23830

What are the meaning of SVM model train output in libSVM

I am conducting a small experiment to figure out how actually SVMs works rather than just messy mathematical equations

Now i searched google and found out several parameters but i am still not sure with few of them

The top output is like this below

svm_type c_svc
kernel_type linear
nr_class 2
total_sv 417
rho -0.215616
label 1 2
nr_sv 222 195
SV

I know the meaning of them except rho. For what task it is used for? Like it is a threshold and if the predicted value lesser than that class 2 or something? or it is the b static parameter in the original formula?

Also i want to learn especially this parameter

For first class

1.015964637640586(?) 1:0.24665231 4:0.14476547 15:0.20357756 16:0.18792053 17:0.24857121 56:0.08635193 130:0.29008309 192:0.3327738 205:0.1299556 538:0.3327738 819:0.40555177 1166:0.24665231 1484:0.23615943 2382:0.4106203 

1.855735328446067(?) 76:0.1757074 108:0.26389822 547:0.26088058 648:0.26916638 765:0.87119196 

For the second class

-0.1420833389096254(?) 1:0.06239991 29:0.021063915 47:0.028132803 316:0.057096583 999:0.069383082 1379:0.075283916 1530:0.081629601 1724:0.98528953 1917:0.060585087 

-2.331507968370806(?) 4:0.18457891 33:0.15922398 150:0.17287198 291:0.21749933 324:0.38461278 349:0.25831757 397:0.26342762 398:0.37451304 483:0.36544162 680:0.30979207 1122:0.33032278 1328:0.31693334 

What are those first parameters? For what task they are being used?

I did put ? at the end of first parameters

The other parameters are attributes and their values

So when we do prediction, the attribute weights are multiplied with each one of the SVs and summed

Then how is the final class decision is made?

Thank you

Upvotes: 0

Views: 572

Answers (1)

sietschie
sietschie

Reputation: 7553

This is the SVM formula from wikipedia: https://upload.wikimedia.org/math/0/b/0/0b0780320368781e4d634c2abe6e1b62.png

rho is equal to -b.

The number in front of the support vectors is the coefficient. This is the weight with which the dot product of the support vector and the input vector is multiplied with. In the formula this is the combination of c and y.

After the weighted dot products are summed up and rho has been subtracted the decision is made by looking at the sign of this computed score. If it is positive it is the first class, if it is negative it is the second class.

Upvotes: 3

Related Questions