k-Nearest-Neighbor for Factorial Based Data This week I read about using the kNN algorithm to predict the outcome of a continuous variable based on the input of one or more continuous variables. The example was predicting the price of a wine bottle based on rating and age.
Is it possible for this to be used to predict a continuous outcome based on factorial based data? For example, predicting the cost of a car based on manufacturer, model, warranty, etc? Or perhaps predicting the attendance of a basketball game based on opponent, day of week, time of day, etc?
In similar situations in the past I have converted each factor to a number, but I'm curious to know if there's a way to skip that step.
 A: The idea of KNN is to use the known labels of data points to predict that of a closeby data point for which you do not have a label. So, you can apply KNN to a dataset as long as there is a measure of distance between objects.
The challenge in your case would be what distance measure to define between two objects (cars). Ask yourself, when would I consider two cars to be similar? Are there manufacturers that are more similar to one another? Of course you can always trivially use a measure in which the distance is 0 if the factor is similar or large otherwise.
Another question is then if you have different types of distance measures for different types, how to combine them. You can always standardize each feature and then use something like euclidean distance, but there a lot of other ways to go, specifically you could give different weights to different features and use that to scale them differently.
The last point is that you have a lot of different options here - you can evaluate everything with appropriate cross-validations and pick the best.
