Say I have a category in one column and its independent subcategories in another column. Is it harmful to include both in a machine learning model or what is common practice?

  • a -> a1
  • a -> a2
  • a -> a3
  • b -> b1
  • b -> b2
  • c -> c1
  • d -> d1
  • d -> d2

I'm assuming these categories are part of the features (predictors). If the combined subcategories encompass the entire category field, then the original category field does not add any information in explaining the response (label) variable(s). The learned ML model with the subcategories will not get any better just by inlcuding the categories.

Including both types increases the correlation between the predictors. There are standard techniques for model selection that deal with reducing the number of features (predictors). You can search for Subset selection, Regression (Shrinkage) methods as well as Principal Component Analysis. But those are mostly for cases where we don't know about feature overlaps (correlations) a priori. In this case, we know before hand.


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.