3
$\begingroup$

I have a data set which has around 1000 samples and are divided in 4 groups - A, B ,C , D. The problem I am facing is that there are very high number of data sample which have B and C s output. They outweigh other two by factor of 3:1. Due to this most of the classification problems are producing very inefficient results with results from other two classes being mapped to A and B quite often . Is there any way to deal with it?

$\endgroup$
2
$\begingroup$

Welcome to DataScience.SE! You need to ensure that your training distribution is similar to your test distribution in order to get the best results. This can be done through stratified sampling. It might be that there is no problem, and that the classifier is simply allocating its resources to best classify the majority case, though I'm a bit confused by your description because you say that B and C dominate and the "other two classes" (A and D) are "mapped to A and B quite often". One option is to use more discriminating features, if you can think of any. Another is to partition the large classes into (B becomes the union of $B_i$ and likewise for C) if applicable. This can help if the shape of the class is complex by breaking it up into learnable pieces. It helps to plot your inputs, colored by class, to understand which classes overlap or have complex shapes. Finally, you can modify your loss function if getting certain classes wrong is more important than others.

| improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ I don't get why he need to ensure that the training distribution should be similar to the test distribution. In this case, shouldn't be the test distribution left untouched? In case of unbalanced classes I would down-size the largest classes to the size of smaller class, but only in the training set. $\endgroup$ – gc5 Sep 13 '16 at 12:28
  • $\begingroup$ Because you want your training set to be representative of your test set, assuming your test set is also representative of data you expect to process. We seek the parameter $\arg \min_w \mathbb E_\theta f(X,Y; w)$ under distribution $\theta$ by minimizing $\frac{1}{N} \sum_i f(x_i,y_i; w) + \lambda r(w)$. The approximation only holds if the samples are from $\theta$, no? $\endgroup$ – Emre Sep 13 '16 at 16:17
2
$\begingroup$

You can try merging the groups A and D which will provide more significant boundaries to the model. Apart from this you can try to sample the given data to form a new data so as to form a uniform distribution of all the groups.

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.