Exercise on regression#
You would like to make a regression model based on the k-nearest neighbor regression for “housing.csv” found in the same directory as this notebook. An advantage of k-nearest neighbor regression is that it requires no assumptions about the data. Furthermore, it has no training phase. The model is defined by the hyperparameters. A disadvantage is its high memory requirement because you need the full training data set for predictions. Furthermore, it struggles with imbalances classes.
You should investigate the role of at least following hyperparameters:
- How many neighbors should be used to predict the price?
- Is it better to equally weight all neighbors or to give closer neighbors more weight?
# your code here