CS340 Machine learning Lecture 4 K-nearest neighbors