Let's say I'm doing an animal image classification task (it doesn't have to be image classification - this is just my example), and the training and test data is balanced across classes. The classes might be ['gorilla', 'giraffe', 'dog', 'donkey']. Now we all know that there is relatively a lot of variance within the 'dog' class compared to the other three classes.

So, is there any way one would treat this problem vs another problem where all classes have about the same amount of variance (where I might replace 'dog' with 'sheep' for instance)?

  • $\begingroup$ you mean something like hierarchical clustering with the target towardsdatascience.com/… $\endgroup$ Commented Mar 25, 2020 at 15:21
  • $\begingroup$ by variance, do you mean that the data points within the dog class are more different from each other than the other classes? $\endgroup$ Commented Mar 25, 2020 at 15:44
  • $\begingroup$ @CarlosMougan not sure I mean that. My example is for supervised training. $\endgroup$ Commented Mar 25, 2020 at 16:24
  • 1
    $\begingroup$ @ValentinCalomme Exactly. Why do I think this matters? Because maybe the space of possible features is very large, and maybe the 'dog' class takes up 90% of that space, and the other 3 classes take 20% (there is overlap). And maybe there are considerations one should make when dealing with this scenario. $\endgroup$ Commented Mar 25, 2020 at 16:27

1 Answer 1


You will want to have many diverse examples of the high variance classes and pick a model that has a high learning capacity. In other words, a large number of samples and a big model to capture the properties of the data.

After training the model, look at the confusion matrix by class for the hold-out dataset to see if the model is learning to generalize for all classes, including the high variance classes.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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