Nearest-neighbor classification with categorical variables