Skip to contents

Train a machine learning model to transfer cell labels (this function implements the caret workflow)

Usage

train_transfer_model(
  fcd,
  input_type,
  data_slot,
  cluster_slot,
  cluster_var,
  method = "knn",
  tuneLength = 5,
  trControl = caret::trainControl(method = "cv"),
  seed = 91
)

Arguments

fcd

flow cytometry dataset.

input_type

Data to use for the calculation of the UMAP, e.g. expr or pca.

data_slot

Name of the input_type data slot to use e.g. orig, if no prefix was added.

cluster_slot

string specifying which clustering slot to use to find variable specified in cluster_var.

cluster_var

string specifying variable name in cluster_slot that identifies cell population labels to be used (e.g. clusters or metaclusters).

method

A string specifying which classification or regression model to use, by default method = "knn". See train for possible values.

tuneLength

An integer denoting the amount of granularity in the tuning parameter grid, default tuneLength = 5.

trControl

A list of values that define how this function acts, default trControl = caret::trainControl(method = "cv"). See trainControl and <http://topepo.github.io/caret/using-your-own-model-in-train.html>.

seed

A seed is set for reproducibility.

Value

train_transfer_model returns a fcd with the model and associated visualizations saved in fcd$extras$lt_model.

Details

train_transfer_model

The train_transfer_model uses train.