Description Usage Arguments Value Author(s)
View source: R/SpecimenIDing_functions.R
This function is for an unbalanced kNN identification design applied to multiple unknown specimens.
1 2 3 4 5 6 7 | KnnDistIDingGroup(
DistMat,
GroupMembership,
UnknownIdentifier = "Unknown",
K,
TieBreaker
)
|
DistMat |
is a square matrix of pairwise distances among all reference specimens. |
GroupMembership |
a character or factor vector in the same order as the distance data to denote group membership. |
UnknownIdentifier |
the name used in the |
K |
is the number of nearest neighbours that the method will use for assigning group classification. |
TieBreaker |
is the method used to break ties if there is no majority resulting from K. Three methods are available('Random', 'Remove' and 'Report'): Random randomly returns one of tied classifications; Remove returns 'UnIDed' for the classification; Report returns a the multiple classifications as a single character string with tied classifications separated by '_'. NOTE: for correct cross-validation proceedures the results of both Report will be considered an incorrect identification even if one of the multiple reported classifications is correct. |
Returns a matrix of the leave-one-out classifications for all the specimens along with their known classificaiton.
Ardern Hulme-Beaman
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.