繁体   English   中英

我可以减少汇总图中解决方案/主题的数量吗?

[英]Can I reduce the number of solutions/topics in a summary plot graph?

在此处输入图片说明 我想绘制一个关于主题随时间变化的图形,K = 100。 这对于图表来说实在太多了,所以我只想要排名最高的10个主题。 就像您在图像中看到的一样。 如何限制这些主题的可读性?

我创建了一个stm,可以绘制所有主题。

anzahl_topic <- 100
dfm2stm <- convert(fed_speeches.dfm.trim, to = "stm")
stm.modell <- stm(dfm2stm$documents, dfm2stm$vocab, K = anzahl_topics, data = dfm2stm$meta, init.type = "Spectral")
plot(stm.modell, type = "summary", text.cex = 0.5, main = "Proportion on the whole Corpus", xlab = "Estimation of Topic")

在按患病率排序的图表中,我有100个主题,但是我只想要该图中的前10个主题。 我认为可能受topic =限制,但我不知道必要的命令(例如:sample仅给出随机主题)。

听起来好像您想绘制一个子集。 在没有可重现的示例的情况下不确定模型对象的结构,但这将是这样的:

top10 <- subset(stm.model1, topics = 10)
plot(top10, type = "summary", text.cex = 0.5, main = "Proportion on the whole Corpus", xlab = "Estimation of Topic")

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM