labelTransfer: labelTransfer

View source: R/labelTransfer.R

labelTransferR Documentation

labelTransfer

Description

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

Usage

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


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)


HristoInouzhe/optimalFlow documentation built on April 23, 2023, 5:45 p.m.