Skip to contents

Train weights for the markers

Usage

train_weights(
  path_to_gs,
  exprs,
  level = 1,
  scaled = FALSE,
  clusters = NULL,
  range = c(1, 5),
  data_split = c(0.7, 0.2, 0.1),
  epochs = 20,
  batch_size = 32,
  run_weights_on_test = TRUE
)

Arguments

path_to_gs

Path to the gene set file without weights

exprs

The expression matrix, or a seurat object (rows: genes, columns: samples/cells)

level

The level of the gene sets to train weights for if you have multiple levels of gene sets.

scaled

Whether the expression matrix is scaled

clusters

A named vector of cluster ids If exprs is a seurat object, this is ignored. The cluster ids are taken from the seurat object.

range

The range of the weights

data_split

A vector of fractions for training, validation and testing. If only two fractions are provided, no testing set will be used.

epochs

The number of epochs to train

batch_size

The batch size

run_weights_on_test

Whether to run the weights on the test set. Requires that data_split has three elements.

Value

A data frame with the weights, that can be used directly by gs_prepare.