optimize_lss | R Documentation |
[experimental] Compute variance ratios with different hyper-parameters
optimize_lss(x, ...)
x |
a fitted textmodel_lss object. |
... |
additional arguments passed to bootstrap_lss. |
optimize_lss()
computes variance ratios with different values of
hyper-parameters using bootstrap_lss. The variance ration v
is defined
as
v = \sigma^2_{documents} / \sigma^2_{words}.
It maximizes when the model best distinguishes between the documents on the latent scale.
## Not run:
# the unit of analysis is not sentences
dfmt_grp <- dfm_group(dfmt)
# choose best k
v1 <- optimize_lss(lss, what = "k", from = 50,
newdata = dfmt_grp, verbose = TRUE)
plot(names(v1), v1)
# find bad seed words
v2 <- optimize_lss(lss, what = "seeds", remove = TRUE,
newdata = dfmt_grp, verbose = TRUE)
barplot(v2, las = 2)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.