adding an implementation of the k nearest neighbor algorithm