Let's suppose I have a dataset which has a categorical variable and the problem I am solving is a classification one.
This categorical variable var has ['A','B','C'] as the possible set of data.
What happens to a decision tree if a new category 'D' is seen only in the validation data set (meaning: absolutely new data)? Supposing the variable var is a feature used in the tree.
With the decision tree:
Does it give an error? The decision tree stops the path and returns the not-final-node's probability?
With the Logistic Regression:
The dummy variables are zero for all the categories (I suppose), and then the model runs normally?
scikit-learn
, but that (currently) requires one-hot encoding even for decision trees, so I'm not sure exactly what you want answered. Similar questions have been asked, but mostly on StackOverflow it seems: stackoverflow.com/questions/41335718/… stackoverflow.com/questions/39804733/… stackoverflow.com/questions/50630447/… $\endgroup$