perplexity {celda} | R Documentation

## Calculate the perplexity from a single celdaModel

### Description

Perplexity can be seen as a measure of how well a provided set of cluster assignments fit the data being clustered.

### Usage

    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` | celdaModel. Options available in 'celda::availableModels'.
`newCounts` | A newCounts 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.

### Examples

    data(celdaCGSim, celdaCGMod)
    perplexity <- perplexity(celdaCGSim$counts, celdaCGMod)

[Package celda version 1.0.4 Index]