perplexityPlot | R Documentation |
the same plot returned by fitLDA() but now callable as a separate function.
perplexityPlot(models, corpus = NULL, perc.rare.thresh = 0.05)
models |
list returned from fitLDA |
corpus |
If corpus is NULL, then it will use the original corpus that the model was fitted to. Otherwise, compute deconvolved topics from this new corpus. Needs to be pixels x genes and nonnegative integer counts. Each row needs at least 1 nonzero entry (default: NULL) |
perc.rare.thresh |
the number of deconvolved cell-types with mean pixel proportion below this fraction used to assess performance of fitted models for each K. Recorded for each K. (default: 0.05) |
a plot indicating the perplexity and number of rare cell-types of a list of fitted LDA models
data(mOB)
pos <- mOB$pos
cd <- mOB$counts
counts <- cleanCounts(cd, min.lib.size = 100)
corpus <- restrictCorpus(counts, removeAbove=1.0, removeBelow = 0.05)
ldas <- fitLDA(t(as.matrix(corpus)), Ks = seq(2,5))
perplexityPlot(models = ldas, corpus = corpus)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.