KNN with mixed data (feature set)
KNN is a classification algorithm where, typically, continuous variables are used to apply a classification. Your problem is a problem of predicting a continuous value using variables that are not continuous.

Your problem presents several challenges which, to me, would suggest KNN isn’t a good choice.


The biggest problem is probably the road_category where you have an ordinal value. Is category 4 four times greater than the difference between category 0 and category 1? Probably not.
No matter how deep your data, due to the fact that your predictors are integers or categorical, your neighbors won’t really be neighbors, more like roommates in a warehouse; you will probably have hundreds of observations on the same vector. So, now you have to choose k values from m observations. So, you will need to come up with an algorithm to do that. Then you’ll have to come up with a methodology to get a prediction. An average might work, but depending on your application, Min or max may be more beneficial.


Bottom line, KNN expects the variables to be close to the same order of magnitude otherwise, larger variables tend to determine the neighbors even if they are not necessarily more important. Some limited categorical variables might be accommodated using dummy variables, but I’d be really careful.

Based on your description of the problem, I think you should continue with regression, but use dummy variable encoding for your categorical values.