See KNeighborsClassifier.kneighbors() method. For each test datum, return a dict with {trip_id: count} pairs. This will provide a measure of confidence in the trip assignment -
e.g. if k=10 and the return is {0: 3, 1: 3, 2: 4} we'll know that it was only assigned trip id = 2 by a narrow margin, vs if the return was {2: 10} which indicates the vote was unanimous.
See KNeighborsClassifier.kneighbors() method. For each test datum, return a dict with {trip_id: count} pairs. This will provide a measure of confidence in the trip assignment -
e.g. if k=10 and the return is {0: 3, 1: 3, 2: 4} we'll know that it was only assigned trip id = 2 by a narrow margin, vs if the return was {2: 10} which indicates the vote was unanimous.