0
$\begingroup$

I am facing a problem. It's a multiclass classification problem I have 5 categories A has 107 instances B has 101 instances C has 882 instances, D has 229 instances and E has 129 instances. I used Knn, random forest and svm I got maximum accuracy score 62% . So, my question is Am I getting low accuracy score because of imbalanced data(since C has 882 instances which are far more than other categories)? or there is something else? NB: I looked the y_pred vector which has the predicted value and I noticed that all the values are 2(I encoded C as 2)why is that?

$\endgroup$
  • $\begingroup$ Biased generally means "not representative of the underlying population" in this context. The word you want is "imbalanced". $\endgroup$ – Matthew Drury Aug 18 '18 at 17:16
  • $\begingroup$ Edited. Do you have any solution for my problem? $\endgroup$ – jongli coder Aug 18 '18 at 18:17
0
$\begingroup$

This is happening because of the imbalanced dataset. In order to avoid overfitting you can use boosting algorithms with trees with depth 1 and do a grid search to find the best boosting parameters. you can use Adaboost in python. Another measure to take is to edit the loss function of the algorithms you tried in to have a proportional loss function. eg If you have 80% class A and 20% class B then have your loss function be: $$L = {Missclassified}_A*(0.2) + {Missclassified}_B*0.8 $$ Ofcourse, you will have t play with the numbers but the idea is there.

$\endgroup$
  • $\begingroup$ Why do you suggest boosting depth one trees? $\endgroup$ – Matthew Drury Aug 19 '18 at 4:24
  • $\begingroup$ You can use other depths but the deeper trees are usually more prone to overfitting. $\endgroup$ – BIM Aug 19 '18 at 18:27

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.