|
Why does as k increases, the error in test data decreases and then slightly increases again? |
|
As k increases, you generally go from underfitting the data (due to a lack of complexity) to overfitting the data (due to too much complexity). There is a sweet spot between the two at which the complexity of the model matches the complexity of the underlying truth in the data, and that is where k should be set. |