I understand how best split is chosen for random forest for numerical predictors (features).
Numerical predictors are sorted then for every value Gini impurity or entropy is calculated and a threshold is chosen which gives the best split. But how best split is chosen for categorical predictor as there is no specific ordering?