train_model | R Documentation |
This function builds the paired bulk-single cell proportion model from input data, and returns the model object for prediction on new bulk data.
train_model( bdat, classprops, numgenevec = 3:10, crossval_times = 5, seedval = 1, method_type = "pearson", quantileval = 0.9, alphavals = seq(from = 0, to = 1, length.out = 11) )
bdat |
Matrix of bulk data, with features (genes, proteins, metabolites) as rows and samples as columns. |
classprops |
Matrix of cell type proportions, with each cell type as a row, and each sample as column. The sample ordering must match those in the bdat bulk matrix. |
numgenevec |
A vector with range of the number of best-fit features to optimize the model over. Usually 10-20 features is sufficient to model ~10 different cell types |
outlist A list containing the following arrays: "cv_preds" with the cross-validation predictions for each value of the numgenevec or alphavals parameter, "cv_errs" with the cross-validation errors for each value of the numgenevec or alphavals parameter, "numgenevec" with the range of best-fit features tested, "cv_bestgenes" with the top features selected for each value of the numgenevec or alphavals parameter, "model" for the trained model, and "modelgenerank" for the final ranking of features used in the model trained on the full data
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.