kNN is a distance-based method, so it requires the input to be in numerical form.
I was wondering if it is possible to use kNN imputer for non-ordinal categorical variables (like color).
Since the input has to be in numerical form, we have to encode the color feature before applying the kNN imputer.
Using ordinal encoding doesn't seem like a good idea. If we assign numbers 1-10 to colors, then the distance-based measurement will assume that the distance between color 1 and 3 is the same as the distance between color 2 and 4. In reality no such relationship exists.
We could use one-hot encoding. Let's say we end up with 10 one-hot encoded color columns, including a column which indicates the missing values. Our task would then be to apply the imputation to the rows which have a 1 in the one-hot-encoded missing-color column. And we would want the imputation to decide which of the other 9 one-hot color columns would have a 1 instead of a 0. But this is generally not at all how kNN imputation works.
Can you advise if using kNN imputation in this case is possible? How can I apply it?