# Highly imbalanced class Machine Learning

I'm currently messing around on a wage dataset (trying to predict who did and didn't earn over 50k p.a. based on a range of factors). One of the variables - 'work-class' is very imbalanced and I was looking for some advice on how to deal with this.

100% of the people within the never-worked and without-pay categories earn over 50k.

Would imputation methods even be useful given the size of groups?

• Imputation of what? This is the size of the groups in a feature not in the target right? – Carlos Mougan Mar 21 at 8:13
• @CarlosMougan so it only really matters if it's the target variable is balanced? – Kelvin Ducray Mar 29 at 5:35

What I'd do is to keep the Unknown class and treat the Never-worked and Without-pay as Unknown.

Imputation methods would just reinforce the bias towards the most dominant class, i.e. private in your case. Say you used a simple classifier to impute these $$21$$ values, it would assign them to another class based on the similarity of the other features (e.g. age, education, ...). Think on what this procedure has done though, it has replaced someone with without-pay to private or something else. This is conceptually wrong, though, especially for a model that tries to predict the income of someone.

Imputation of what? This is the size of the groups in a feature not in the target right?

Imbalanced class imputation method refers to the target(y). In the features(X) the important thing is that the quality of the data is good.

Your goal is to predict the earnings of people. In the preprocessing part of the problem what you will like to handle this feature in the best possible way (data wrangling, imputation...). But when it come to predictions you don't need to take care of imbalanced class since your target is not imbalanced.

Imbalance makes sense in classification (binary, multi) but not in regression. I understand that your target is continous.

• Hi Carlos, the problem here is classification. Either >50K p.a. or <50k p.a. – Kelvin Ducray Mar 30 at 2:19

Kelvin,

As above other they've said, imbalanced X has more importance in classification problems. If you have to use handle this problem I could propose:

• Find in class "Unknown" most similar rows to rows in categories "Never-worked" or "Without-pay" and concatenate them.
• You could redefine your categories for a less(more) number of categories.
• You could check out resampling techniques like SMOTE

Some implementations you will find in the link:

https://www.kaggle.com/rafjaa/resampling-strategies-for-imbalanced-datasets

• I think he is also refering to the features and not to the target – Carlos Mougan Mar 29 at 11:14