perplexity: Calculate the perplexity of a celda model

Description Usage Arguments Value Examples

Description

Perplexity is a statistical measure of how well a probability model can predict new data. Lower perplexity indicates a better model.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
perplexity(x, celdaMod, ...)

## S4 method for signature 'SingleCellExperiment,ANY'
perplexity(
  x,
  useAssay = "counts",
  altExpName = "featureSubset",
  newCounts = NULL
)

## S4 method for signature 'matrix,celda_CG'
perplexity(x, celdaMod, newCounts = NULL)

## S4 method for signature 'matrix,celda_C'
perplexity(x, celdaMod, newCounts = NULL)

## S4 method for signature 'matrix,celda_G'
perplexity(x, celdaMod, newCounts = NULL)

Arguments

x

Can be one of

  • A SingleCellExperiment object returned by celda_C, celda_G or celda_CG, with the matrix located in the useAssay assay slot. Rows represent features and columns represent cells.

  • Integer counts matrix. Rows represent features and columns represent cells. This matrix should be the same as the one used to generate celdaMod.

celdaMod

Celda model object. Only works if x is an integer counts matrix.

...

Ignored. Placeholder to prevent check warning.

useAssay

A string specifying which assay slot to use if x is a SingleCellExperiment object. Default "counts".

altExpName

The name for the altExp slot to use. Default "featureSubset".

newCounts

A new counts matrix used to calculate perplexity. If NULL, perplexity will be calculated for the matrix in useAssay slot in x. Default NULL.

Value

Numeric. The perplexity for the provided x (and celdaModel).

Examples

1
2
3
4
5
6
7
8

celda documentation built on Nov. 8, 2020, 8:24 p.m.