precisionRecall: #' Find prototypes given clustering, and radius (maximum...

Description Usage Arguments Value

Description

#' Find prototypes given clustering, and radius (maximum distance to prototype) #' #' Given pairwise similarities and links (a clustering), find prototypes for #' each cluster and maximum distance to prototype for that cluster. The output #' is a data frame with one row representing one cluster, and the metric max #' minimax radius for the given clustering is given by max(out$minimaxRadius). #' #' @param allPairwise name of data frame containing all pairwise comparisons. #' This needs to have at least four columns, one representing the first item #' in the comparison, one representing the second item, one representing #' whether the pair is linked in the given clustering, and the last #' representing a distance or similarity metric. These are enumerated in the #' next three parameters. #' @param distSimCol name of column in 'allPairwise' indicating distances or #' similarities, input as character, e.g. "l2dist". If this is a similarity #' and not a difference, input 'myDist' parameter to be FALSE. If a similarity #' measure is used, distance will be calcualted as 1 - similarity. #' @param linkCol name of column in 'allPairwise' with links, input as #' character, e.g. "minimax0.4" #' @param pairColNums vector of length 2 indicating the column numbers in #' 'allPairwise' of 1. item 1 in comparison, 2. item 2 in comparison #' @param myDist is 'distSimCol' a distance or similarity measure? Default TRUE, #' i.e. distance measure #' #' @return data frame with columns 'cluster', 'minimaxRadius', 'prototype'. The #' metric max minimax radius for the given clustering is given by #' max(out$minimaxRadius) #' #' @importFrom magrittr " #' @importFrom dplyr group_by summarize #' @export

Usage

1
precisionRecall(allPairwise, linkCol, matchColNum)

Arguments

allPairwise

name of data frame containing all pairwise comparisons. This needs to have at least two columns, one representing whether the pair is linked in the given clustering, and one representing the true match/non-match status. These are enumerated in the next two parameters.

linkCol

name of column in 'allPairwise' with links, input as character, e.g. "minimax0.4"

matchColNum

column number of column in 'allPairwise' indicating true match/non-match status

Value

list with two items, 'precision' and 'recall'


xhtai/cartridges documentation built on June 1, 2019, 2:58 p.m.