mrgeorge / BusTripper

Identify bus trips from GPS locations
3 stars 1 forks source link

update knn call to return votes from neighbors #14

Closed mrgeorge closed 10 years ago

mrgeorge commented 10 years ago

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.