New answers tagged

0

You can map M to 0 and F to 1. In general, if you have N categories, you can map each category to a number in the range 1,2,..,N. If N=2, this is fine for a k-nearest neighbor classifier. If N>2, this is not a good idea for a k-nearest neighbor classifier, as it makes some assumptions (e.g., that the first category is more similar to the second category ...


0

It's something about parameter tuning. You should change the K-value from lower values to high values and keep track of all accuracy value. But as whole if you choose the lower values in kNN your model will learn to predict more locally while if you choose the large values for kNN your model will learn to predict more globally.


Top 50 recent answers are included