R. Quanteda程序包如何过滤dfm_tfidf中存在的值?

问题描述

所以我有一个dfm_tfidf,我想过滤掉低于某个阈值的值。

代码:

dfmat2 <-
  matrix(c(1,1,2,3),byrow = TRUE,nrow = 2,dimnames = list(docs = c("document1","document2"),features = c("this","is","a","sample","another","example"))) %>%
  as.dfm()


#it works
dfmat2 %>% dfm_trim(min_termfreq = 3)

#it does not work
dfm_tfidf(dfmat2) %>% dfm_trim( min_termfreq = 1)
# "Warning message: In dfm_trim.dfm(.,min_termfreq = 1) : dfm has been previously weighted"

问题:如何过滤出dfm_tfidf中存在的值?

谢谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)