perplexity,celda_CG-method {celda} | R Documentation |
Perplexity is a statistical measure of how well a probability model can predict new data. Lower perplexity indicates a better model.
## S4 method for signature 'celda_CG' perplexity(counts, celdaMod, newCounts = NULL)
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", "celda_G" or "celda_CG". |
newCounts |
A new counts matrix used to calculate perplexity. If NULL, perplexity will be calculated for the 'counts' matrix. Default NULL. |
Numeric. The perplexity for the provided count data and model.
'celda_CG()' for clustering features and cells
data(celdaCGSim, celdaCGMod) perplexity <- perplexity(celdaCGSim$counts, celdaCGMod)