Rizwan Mian | 14 Aug 2012 18:25
Picon

SVMs for unbalanced data?

Hi Folks,

Is there any way to view the support vectors (or better yet their number) for non-linear kernels in LibSVM?

I am using non-linear RBF kernel. I believe the number of support vectors is important in discovering if the SVM is over-fitting. It is possible to view the support vectors for non-linear kernels in SMOReg. However, I am unable to assign different C values to different classes in SMOReg. This is needed because I need to assign different weights to different classes because my data set is unbalanced i.e. one class contains a lot more examples than the other. The imbalance raises a problem that SVM assigns equal importance to errors made on examples belonging to the majority class and the minority class. To correct for the imbalance in the data, we need to assign different costs for misclassification to each class. [1]

The alternate would be to assign different C values to different classes in SMOReg. Is that possible?

thaking in advance. 
Rizwan :-)

--
Rizwan Mian
Doctoral Candidate
School of Computing (Sum Ergo Computo)
Queens University
http://research.cs.queensu.ca/~mian/index.htm
_______________________________________________
Wekalist mailing list
Send posts to: Wekalist <at> list.scms.waikato.ac.nz
List info and subscription status: https://list.scms.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Bernhard Pfahringer | 15 Aug 2012 00:29
Picon

Re: SVMs for unbalanced data?

Hi,

while you cannot assign different C values to different classes,
what you can do is use different weights for examples. You can
increase the weights of the minority class examples such that
their sum equals the weight sum of the majority.

weka.classifiers.meta.CostSensitiveClassifier uses this idea.

One word of caution if you write your own code: do not
adjust your weights such that the sums are 1.0, rather
make the weightSum ~ numberOfExamples. I am not sure
about SMO(reg), but many schemes in Weka implicitly
assume that your average instance weight is around 1.0.
If it is much smaller (like 1/numOfEx), then such examples
might be pruned away or effectively be ignored.

hth, Bernhard

On Wed, Aug 15, 2012 at 4:25 AM, Rizwan Mian <vizvan <at> gmail.com> wrote:
> Hi Folks,
>
> Is there any way to view the support vectors (or better yet their number)
> for non-linear kernels in LibSVM?
>
> I am using non-linear RBF kernel. I believe the number of support vectors is
> important in discovering if the SVM is over-fitting. It is possible to view
> the support vectors for non-linear kernels in SMOReg. However, I am unable
> to assign different C values to different classes in SMOReg. This is needed
> because I need to assign different weights to different classes because my
> data set is unbalanced i.e. one class contains a lot more examples than the
> other. The imbalance raises a problem that SVM assigns equal importance to
> errors made on examples belonging to the majority class and the minority
> class. To correct for the imbalance in the data, we need to assign different
> costs for misclassification to each class. [1]
>
> The alternate would be to assign different C values to different classes in
> SMOReg. Is that possible?
>
> thaking in advance.
> Rizwan :-)
>
> --
> Rizwan Mian
> Doctoral Candidate
> School of Computing (Sum Ergo Computo)
> Queens University
> http://research.cs.queensu.ca/~mian/index.htm
>
> _______________________________________________
> Wekalist mailing list
> Send posts to: Wekalist <at> list.scms.waikato.ac.nz
> List info and subscription status:
> https://list.scms.waikato.ac.nz/mailman/listinfo/wekalist
> List etiquette:
> http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
>

--

-- 
---------------------------------------------------------------------
Bernhard Pfahringer, Dept. of Computer Science, University of Waikato
http://www.cs.waikato.ac.nz/~bernhard                  +64 7 838 4041

_______________________________________________
Wekalist mailing list
Send posts to: Wekalist <at> list.scms.waikato.ac.nz
List info and subscription status: https://list.scms.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html


Gmane