fix weighted mean for kNN