Java artificial intelligence KNN classification algorithm