This function makes prediction of rankings based on the nearest neighbor
1 |
train.x |
is matrix of numeric attributes in training sample |
y |
is matrix of training rankings |
test.x |
is a vector of new numeric attributes for which to predict rankings |
n |
is a parameter of 'memory' of how fast the past rankings gets forgotten. (see details of time_weights). By default, |
k |
is the number of the nearest neighbors to consider (default k=3) |
A function predicts the rankings based on the euclidean distance between train and test attributes.
a vector of predicted ranking for attribute test.x
1 2 3 |
Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
All documentation is copyright its authors; we didn't write any of that.