Calculate the distance between the input molecule and the kth-nearest training instances.(1 ≤ kth ≤ 3631)