KNN machine learning model for OTB which is able to use a generic distance between samples