# How to deal with broad and narrow variance within classes in classification tasks

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)?

• you mean something like hierarchical clustering with the target towardsdatascience.com/… – Carlos Mougan Mar 25 at 15:21
• by variance, do you mean that the data points within the dog class are more different from each other than the other classes? – Valentin Calomme Mar 25 at 15:44
• @CarlosMougan not sure I mean that. My example is for supervised training. – Alexander Soare Mar 25 at 16:24
• @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. – Alexander Soare Mar 25 at 16:27