move train_knn to libknn