我正在尝试使用R包topicmodels进行一些主题建模
根据这些说明R text file and text mining...how to load data,我已经使用'tm‘包进行了预处理。
但是,当我在R中使用topicmodels运行我的相关主题模型(CTM)时,我收到以下错误
"Error in CTM...DocumentTermMatrix needs to have a term frequency weighting. 我已经三次检查了我的DocumentTermMatrix的结构,显示它确实有一个频率权重:
A document-term matrix (26 documents, 413 terms)
Non-/sparse entries: 4804/5934
Sparsity : 55%
Maximal term length: 13
Weighting : term frequency - inverse document frequency (normalized) (tf-idf)任何关于如何让这个工作的建议都将不胜感激!
发布于 2013-05-06 17:35:46
如果您之前使用的是slam包,则需要将加权参数指定为weightTf:
m=as.simple_triplet_matrix(mm);
dtm <- as.DocumentTermMatrix(m,weighting =weightTf)https://stackoverflow.com/questions/14697218
复制相似问题