Description Usage Arguments Details Value See Also
k-Nearest Neighbors
the k.nearest.neigbors
gives the list of points (k-Neigbours) that are closest
to the row i in descending order.
1 | k.nearest.neighbors(i, distance_matrix, k = 5)
|
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. |
The output of this function is used in the knn_test_function
function.
a k vector with the k closest neigbours to the i observation.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.