KNN diagram in machine learning