A more flexible KNN