Open TommyJones opened 4 years ago
Confirmed that this does not respect R's random seed.
Run the below a few times and get different results even with the same seed.
set.seed(1234)
Nk <- 4
Nd <- 50
Nv <- 1000
alpha <- rgamma(Nk, 0.5)
beta <- generate_zipf(vocab_size = Nv, magnitude = 500, zipf_par = 1.1)
pars <- sample_parameters(alpha, beta, Nd)
doc_lengths <- rpois(Nd, 50)
dtm <- sample_documents(
theta = pars$theta,
phi = pars$phi,
doc_lengths = doc_lengths,
threads = 7 ## threads controls parallel computation
)
colnames(dtm) <- colnames(pars$phi)
head(sort(colSums(dtm), decreasing = T))