R语言实现:library(tidyverse)
1、Ndocs = 500 WordsPerDoc = rpois(Ndocs, 100)
2、 thetaList = list(c(A=.60, B=.25, C=.15),c(A=.10, B=.10, C=.80)) //主题A、B、C
theta_1 = t(replicate(Ndocs/2, thetaList[[1]]))
theta_2 = t(replicate(Ndocs/2, thetaList[[2]]))
theta = rbind(theta_1, theta_2) //500行3列
原文地址:https://www.cnblogs.com/yao1996/p/10221708.html
时间: 2024-10-01 12:34:44