Reputation: 93
I am new to SVMlight. I downloaded the source code and compiled SVMlight.
I created training and testing data sets. And ran
[command]
creating a model file. Using this model file, I ran svm_classify creating a prediction file. The prediction file contains some values.
What do these numbers represent? I would like to classify my data into -1 and +1, but I see no such values in prediction file.
model file :
SVM-light Version V6.02
0 # kernel type
3 # kernel parameter -d
1 # kernel parameter -g
1 # kernel parameter -s
1 # kernel parameter -r
empty# kernel parameter -u
9947 # highest feature index
2000 # number of training documents
879 # number of support vectors plus 1
-0.13217617 # threshold b, each following line is a SV (starting with alpha*y)
-1.0000000005381390888459236521157 6:0.013155501 9:0.10063701 27:0.038305663 41:0.12115256 63:0.056871183 142:0.020468477 206:0.12547429 286:0.073713586 406:0.12335037 578:0.40131235 720:0.13097784 960:0.30321017 1607:0.17021149 2205:0.5118736 3177:0.54580438 4507:0.27290219 #
-0.61395623101405172317157621364458 6:0.019937159 27:0.019350741 31:0.025329925 37:0.031444062 42:0.11928168 83:0.03443896 127:0.066094264 142:0.0086166598 162:0.035993244 190:0.056980081 202:0.16503957 286:0.074475288 323:0.056850906 386:0.052928429 408:0.039132856 411:0.049789339 480:0.048880257 500:0.068775021 506:0.037179198 555:0.076585822 594:0.063632675 663:0.062197074 673:0.067195281 782:0.075720288 834:0.066969693 923:0.44677126 1146:0.076086208 1191:0.5542227 1225:0.059279677 1302:0.094811738 1305:0.060443446 1379:0.070145406 1544:0.087077379 1936:0.089480147 2451:0.31556693 2796:0.1145037 2833:0.20080972 6242:0.1545693 6574:0.28386003 7639:0.29435158 #
etc...
prediction file:
1.0142989
1.3699419
1.4742762
0.52224801
0.41167112
1.3597693
0.91790572
1.1846312
1.5038173
-1.7641716
-1.4615855
-0.75832723
etc...
Upvotes: 4
Views: 529
Reputation: 3253
In your training file, did you provide known classes (+1, -1)? i.e.
-1 1:0.43 3:0.12 9284:0.2 # abcdef
Can you provide an excerpt of this file as well as the commands you ran?
The prediction file holds the values for each data point according to the model you trained. You may consider that values below 0 classify the datapoint into the -1 category and above 0 into the +1 category.
When you run the classification on the training set, you will see where the model works and where it fails.
Upvotes: 1