Sai Sindhura Tipirneni
Sai Sindhura Tipirneni

Reputation: 121

sklearn KNN regression does not give 0 training error for k=1

I am trying out sklearn's KNN regressor. I expect it to have 0 training error for k=1. I am getting a mean square training error of 0.071. Is this possible?

Upvotes: 0

Views: 186

Answers (1)

Sai Sindhura Tipirneni
Sai Sindhura Tipirneni

Reputation: 121

Figured out. When two training samples have same input and different output, the regressor doesn't consider both for k=1. It considers only one of them.

Upvotes: 1

Related Questions