I have a dataset, say 9000 rows, with some features. Around 8000 belong to class 1 and 1000 to class 0. So, if I am creating a model with any method say SVM, LR, Random forest the model has a tendency to give more prediction to class 1. So I have two things in mind:

a) I want to separate 8000 rows belonging to class 1 into 4 groups and use each group with those 1000 rows belonging to class 0 and create a model. After that I thought of averaging over the models. My first question is, averaging over the models as in theory means really what. Does it mean that we have to sum over the coefficients of each model and take the average? I am stuck with that part of averaging. And is my approach a good one?

b) Another approach I am thinking of is to replicate the 1000 rows belongs to class 0 8 times to get 8000 rows of 0. So, total data will be 16000. Will the duplication result in new information? Will it tend to overfit?

Is there any approach to deal with these unbalanced data?

  • $\begingroup$ This answer to a similar question covers the details of how to implement a class weighting scheme in scikit-learn: stackoverflow.com/questions/18078084/… $\endgroup$
    – Jim K.
    Apr 21 '15 at 23:15
  • $\begingroup$ If either approach were a good idea, they would be explained prominently and early in every statistics course. But on the whole this is not a problem. The data are what they are. You might as well say that data with a few giants and a majority of people of more typical height is unbalanced, so we need to replicate the giants. Not so, even though very small frequencies can make quantities difficult to estimate. And sometimes very large groups are larger than we want to handle. But in your situation, on the whole, this problem is not a problem. $\endgroup$
    – Nick Cox
    Apr 22 '15 at 2:12
  • $\begingroup$ @Jim K - Thanks to a new insight . It was really helpful. $\endgroup$ Apr 22 '15 at 12:26
  • $\begingroup$ You could look for samples with high entropy and give these more weight (active learning) $\endgroup$
    – MarcelB
    May 28 at 17:10