k_nearest_neighbour | R Documentation |
Preform k-nearest-neighbour classification from a similarity matrix and a list classifying the columns into groups.
k_nearest_neighbour(x, group_definitions, k = 5, exclude_self_sharing = T)
x |
matrix. The input similarity matrix. |
group_definitions |
tibble. A tibble with two columns that specifies the name of each column in the input matrix and the grouping it belongs to. |
k |
integer. The number of nearest neighbours to use for classification. |
exclude_self_sharing |
logical. Should self sharing be excluded? If so, the highest sharing in each row is ignored (assumed to be self-sharing). |
Tibble. A tibble containing the assigned group of the k nearest neighbours as well as the accuracy of the knn at assigning the correct grouping based on the similarity scores for each row in the input matrix.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.