View source: R/reconcile_clusterings.R
reconcile_clusterings_mapping | R Documentation |
When forcing one-to-one, the user needs to decide what to prioritize:
"accuracy": optimize raw count of all observations with the same label across the two assignments
"precision": optimize the average percent of each alt cluster that matches the corresponding primary cluster
reconcile_clusterings_mapping(
primary,
alternative,
one_to_one = TRUE,
optimize = "accuracy"
)
primary |
A vector containing cluster labels, to be matched |
alternative |
Another vector containing cluster labels, to be changed |
one_to_one |
Boolean; should each alt cluster match only one primary cluster? |
optimize |
One of "accuracy" or "precision"; see description. |
Retains the cluster labels of the primary assignment, and relabel the alternate assignment to match as closely as possible. The user must decide whether clusters are forced to be "one-to-one"; that is, are we allowed to assign multiple labels from the alternate assignment to the same primary label?
A tibble with 3 columns; primary
, alt
, alt_recoded
factor1 <- c("Apple", "Apple", "Carrot", "Carrot", "Banana", "Banana")
factor2 <- c("Dog", "Dog", "Cat", "Dog", "Fish", "Fish")
reconcile_clusterings_mapping(factor1, factor2)
factor1 <- c("Apple", "Apple", "Carrot", "Carrot", "Banana", "Banana")
factor2 <- c("Dog", "Dog", "Cat", "Dog", "Fish", "Parrot")
reconcile_clusterings_mapping(factor1, factor2, one_to_one = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.