2
votes

I am working with SVM-light. I would like to use example dependent costs for training my model.

Although on the top page (SVM-light) it says "can train SVMs with cost models and example dependent costs ", I cannot figure out how.

Can someone explain how to use this feature of SVM-light or point me to any document that explains how to do this?

EDIT: I figured out that I can specify "cost" in my example file. So each line of my example file becomes something like:

< line > .=. < target > cost:< value > < feature >:< value > < feature >:< value > ... < feature >:< value > # < info >

2

2 Answers

1
votes

You can accomplish this by manipulating the training set. Specifically, if you want to weight some example x n times as much as other samples, simply include this example n times in the train set; mistakes on x will then be n times as costly.

1
votes

I figured out that I can specify "cost" in my example file. So each line of my example file becomes something like:

< line > .=. < target > cost:< value > < feature >:< value > < feature >:< value > ... < feature >:< value > # < info >