k.nearest.neighbors {FastKNN} | R Documentation |
k-Nearest Neighbors
the k.nearest.neigbors
gives the list of points (k-Neigbours) that are closest
to the row i in descending order.
Description
k-Nearest Neighbors
the k.nearest.neigbors
gives the list of points (k-Neigbours) that are closest
to the row i in descending order.
Usage
k.nearest.neighbors(i, distance_matrix, k = 5)
Arguments
i |
is from the numeric class and is a row from the distance_matrix. |
distance_matrix |
is a nxn matrix. |
k |
is from the numeric class and represent the number of neigbours that the function will return. |
Details
The output of this function is used in the knn_test_function
function.
Value
a k vector with the k closest neigbours to the i observation.
See Also
order
[Package FastKNN version 0.0.1 Index]