eltonlaw / impyute

Data imputations library to preprocess datasets with missing data
http://impyute.readthedocs.io/
MIT License
352 stars 49 forks source link

Updated fast_knn.py to avoid division by 0 #79

Closed tahmidmehdi closed 5 years ago

tahmidmehdi commented 5 years ago

The fast_knn function has stability issues if we're using Sheperd's weight function and distances are 0. In the fast_knn function, I added a small constant to distances to avoid division by 0.

eltonlaw commented 5 years ago

LGTM. Thanks for the PR!

tahmidmehdi commented 5 years ago

No problem! I've been using this at work & it seems to be the only knn imputation function that isn't too slow.