resamplePerplexity {celda}R Documentation

Calculate and visualize perplexity of all models in a celdaList, with count resampling

Description

Calculates the perplexity of each model's cluster assignments given the provided countMatrix, as well as resamplings of that count matrix, providing a distribution of perplexities and a better sense of the quality of a given K/L choice.

Usage

resamplePerplexity(counts, celdaList, resample = 5)

Arguments

counts

Integer matrix. Rows represent features and columns represent cells. This matrix should be the same as the one used to generate 'celda.mod'.

celdaList

Object of class 'celdaList'.

resample

Integer. The number of times to resample the counts matrix for evaluating perplexity. Default 5.

Value

celdaList. Returns the provided 'celdaList' with a 'perplexity' property, detailing the perplexity of all K/L combinations that appeared in the celdaList's models.

Examples

data(celdaCGSim, celdaCGGridSearchRes)
celdaCGGridSearchRes <- resamplePerplexity(
  celdaCGSim$counts,
  celdaCGGridSearchRes)
plotGridSearchPerplexity(celdaCGGridSearchRes)

[Package celda version 1.0.0 Index]