Reputation: 1
I'm new to using KNN and in my train set I have velocity vector. Since the directions 359° and 0° are completely different I was thinking of transforming the direction so that the vector in test data it points to 180°.
I could make this transformation before using KNeighborsClassifier if I predict from one data point, but when I tune the hyperparameters with GridSearchCV the transformation should be done between every comparison. Is there some way to do that?
Or some alternative way that I'm missing?
Upvotes: 0
Views: 120
Reputation: 837
You can break direction column, theta
into 2 columns, sin(theta)
and cos(theta)
, both of which would have continuity.
Upvotes: 0