nfmcclure / tensorflow_cookbook

Code for Tensorflow Machine Learning Cookbook
https://www.packtpub.com/big-data-and-business-intelligence/tensorflow-machine-learning-cookbook-second-edition
MIT License
6.23k stars 2.41k forks source link

the code forget normalized inverse of the distance #155

Closed yuanxiaosc closed 5 years ago

yuanxiaosc commented 5 years ago

your: Batch #1 MSE: 14.38 After correction: Batch #1 MSE: 10.625 "We also have to choose how to weight the distances. A straight forward way to weight the distances is by the distance itself. Points that are further away from our prediction should have less impact than nearer points. The most common way to weight is by the normalized inverse of the distance."--according to your "Nearest Neighbor Methods Introduction".

nfmcclure commented 5 years ago

Thanks for spotting this mistake! This is very helpful.