Learn Before
Relation
The important parameters of KNN classifier and regressor
(1) n_neighbors: the number of nearest neighbors to consider. The default value is 5. For a very low value of n_neighbors leads to overfitting on the training data, while high value of n_neighbors will make the model perform poorly on both train and validation set. We can draw a validation error curve to determine the optimal value of n_neighbors. (2) metric: distance function between data points. The default value is Minkowski distance with power parameter p=2, which is equivalent to the standard Euclidean metric.
0
2
Updated 2020-09-06
Tags
Data Science