transfer_labels: Transfer labels from the reference to the query data set

View source: R/proj.r

transfer_labelsR Documentation

Transfer labels from the reference to the query data set

Description

A kNN classifier is used to predict labels of the query data, given the reference data with the same data representation

Usage

transfer_labels(
  data_ref = NULL,
  data_query = NULL,
  knn_ref_query = NULL,
  label_ref,
  k = 50,
  thres_prop_match = 0.5,
  return_all = FALSE,
  verbose = TRUE
)

Arguments

data_ref

Reference data matrix

data_query

Query data matrix

knn_ref_query

KNN matrix, where each row represents one sample in the query data, and each column represents one nearest neighbors in the reference data. If NULL, it is calculated using data_ref and data_query

label_ref

Class labels of each sample in the reference

k

Number of neighbors for classification

thres_prop_match

If no class gets higher supported proportion than this value, the prediction fails for the query sample and NA is returned

return_all

Whether to return all results including the transferred labels and the kNN proportions. Only the transferred labels are returned when it is FALSE

verbose

Whether to output the verbose message

Value

A vector of the predicted/transferred labels of the query data


quadbiolab/simspec documentation built on March 8, 2024, 11:59 p.m.