Can I use KNN impure for categorical non-ordinal data? I'm working on UCI Adult dataset and there are missing values in 3 categorical variables. The problem is values are not ordinal so I cannot assign numerical values to the categories. Is there a way around it? Can I use KNN in some way?
Tried the simple code:
impute_knn = KNNImputer(n_neighbors = 2)
impute_knn.fit_transform(X)
and of course it's not working as the data is object
type