perplexity,celda_C-method {celda} | R Documentation

## Calculate the perplexity on new data with a celda_C model

### Description

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

### Usage

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

### Arguments

`counts` | Integer matrix. Rows represent features and columns represent cells. This matrix should be the same as the one used to generate 'celdaMod'.
`celdaMod` | Celda object of class "celda_C"
`newCounts` | A new counts matrix used to calculate perplexity. If NULL, perplexity will be calculated for the 'counts' matrix. Default NULL.

### Value

Numeric. The perplexity for the provided count data and model.

### See Also

'celda_C()' for clustering cells

### Examples

    data(celdaCSim, celdaCMod)
    perplexity <- perplexity(celdaCSim$counts, celdaCMod)

[Package celda version 1.0.4 Index]