transfer_labels | R Documentation |
A kNN classifier is used to predict labels of the query data, given the reference data with the same data representation
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
)
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 |
A vector of the predicted/transferred labels of the query data
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.