I'm new to decision trees and I have some confusion about how factor variables and non-ordered character/string variables get handled in a split.
Suppose I have a factor such as "tiny, small, medium, large, huge" where the levels are important. How does a decision tree try to find the best split? Will it only check the 4 obvious splits, or will it check splits for weird combinations like, "tiny or huge but not small medium or large"?
Similarly, how does a decision tree check for a split for an unordered character variable such as "New Orleans, Birmingham, Jackson, Miami, Atlanta"?
I'm using the rpart package in R as I try to learn this stuff, so any references to rpart's implementation would be helpful.