I am working on a decision tree model and trying to decide how best to handle categorical features. The features in my dataset are generally high in cardinality and I have found that ordinal labeling does better than dummy encoding. I wonder if I can take this a step further and if, instead of assigning random numeric codes, I could assign them based on their correlation with the target variable.
For example, let us say one of my features is
sales_rep_name and I am trying to predict whether there is a large or small sale. I could rank the sales reps by the proportion of large sales and use that ranking as ordinal labeling. That way when the decision tree makes its splits, it is keeping low selling reps on one side of the tree and high selling reps on the other side of the tree. Is there a flaw in this logic? Could this lead to overfitting?