I have an unbalanced data and I want to use LibSVM at matlab. LibSVM has two different parameters for cost: -c and -wi. What is the difference between them?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
-c option is to set the hyper-parameter value. Since, you have unbalanced data, it tries to minimize error for class with large number of examples compared to class with less number of examples.
Now, one-way is to somehow suggest to the algorithm that error for class with smaller number of examples should be given more weightage compared to the other class. You do so by using the -w option.
Say: You have two classes +1 and -1. +1 examples are less in number compared -1 class.So, you want to give more weightage to +1 class. Now, you can set the parameters as,
-w+1 10 -c Cwould indicate that error for positive class should be given roughly 10 times more weightage than negative class in Binary Classification.
The values to be used with -c and -w are selected using cross-validation technique.