optimalModel: Get the optimal LDA model

View source: R/functions.R

optimalModelR Documentation

Get the optimal LDA model

Description

Get the optimal LDA model

Usage

optimalModel(models, opt)

Arguments

models

list returned from fitLDA

opt

either "kneed" (kOpt1) or "min" (kOpt2), or designate a specific K. "kneed" = K vs perplexity inflection point. "min" = K corresponding to minimum perplexity "proportion" = K vs number of cell-type with mean proportion < 5% inflection point

Value

optimal LDA model fitted to the K based on opt parameter

Examples

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,4), ncores=2)
optLDA <- optimalModel(models = ldas, opt = "min")


JEFworks-Lab/STdeconvolve documentation built on Nov. 14, 2024, 7:24 p.m.