labelTransfer: labelTransfer

Description Usage Arguments Value Examples

View source: R/labelTransfer.R

Description

Label transfer between a test partition and a training set of partitions.

Usage

1
2
3
4
5
6
labelTransfer(
  training.cytometry,
  test.cytometry,
  test.partition,
  equal.weights = FALSE
)

Arguments

training.cytometry

List of partitions, where each partition is a dataframe where the last column contains the labels of the partition.

test.cytometry

Test data, a dataframe without labels.

test.partition

Labels of a partition of the test data.

equal.weights

If True, weights assigned to every cluster in a partion are uniform (1/number of clusters) when calculating the similarity distance. If False, weights assigned to clusters are the proportions of points in every cluster compared to the total amount of points in the partition.

Value

A fuzzy relabeling consistent of a transportation plan.

Examples

1
2
3
4
data.example <- data.frame(v1 = c(rnorm(50, 2, 1), rnorm(50, -2, 1)),
                          v2 = c(rnorm(50, 2, 1), rnorm(50, -2, 1)), id = c(rep(0, 50), rep(1, 50)))
test.labels <- c(rep('a', 50), rep('b', 50))
labelTransfer(data.example, data.example[, 1:2], test.labels)

optimalFlow documentation built on Nov. 8, 2020, 6:59 p.m.