# Does GBM classification suffer from imbalanced class sizes?

I'm dealing with a supervised binary classification issue. I'd like to use the GBM package to classify individuals as uninfected/infected. I have 15 times more uninfected than infected individuals.

I was wondering if GBM models suffer in the case of imbalanced class sizes? I didn't find any references answering this question.

I tried to adjust the weights by assigning a weight of 1 to the uninfected individuals and a weight of 15 to the infected, but I obtained poor results.

• (side note) It would be helpful if you provided what GBM stands for and a link to the package. Aug 10 '15 at 12:58
• Which loss function are you using for your gradient boosting model? When it comes to imbalanced classes, I've seen poor performance when I've used mean absolute error because it seems to favor the most common class. When I used mean squared error the performance improved substantially Aug 12 '15 at 18:38
• Just for future reference, I find the default loss function used by caret logarithmic loss (cross-deviance) to be pretty helpful as well. ( it penalize heavily on the wrong cases in a negative logarithmic scale) Aug 17 '17 at 5:04

In my experience, GBM does indeed suffer from imbalanced class sizes. I have had good success using SMOTE sampling, which creates synthetic data while oversampling the minority class. You can find it in the DMwR package.