Added k nearest neighbor training.