bug fix for comparing the union of the other sets other than the test set for knn