LouisD4
LouisD4

Reputation: 41

Structural Topic Model (STM) Error: UNRELIABLE VALUE: Future (‘<none>’) unexpectedly generated random numbers without specifying argument 'seed'

After running my stm several times successfully, I now get this error message every time I try to run it:

UNRELIABLE VALUE: Future (‘<none>’) unexpectedly generated random numbers without specifying argument 'seed'. There is a risk that those random numbers are not statistically sound and the overall results might be invalid. To fix this, specify 'seed=TRUE'. This ensures that proper, parallel-safe random numbers are produced via the L'Ecuyer-CMRG method. To disable this check, use 'seed=NULL', or set option 'future.rng.onMisuse' to "ignore".

This is the code I ran:

many_models <- data_frame(K = c(10, 20, 30, 40, 50, 60)) %>%
mutate(topic_model = future_map_dbl(K, ~stm(tweet_df_sparse, K = .,
verbose = FALSE)))

Any idea how to quickly fix it?

Upvotes: 4

Views: 2218

Answers (1)

aterhorst
aterhorst

Reputation: 685

Need to add seed = TRUE to future_map_dbl()

many_models <- data_frame(K = c(10, 20, 30, 40, 50, 60)) %>%
mutate(topic_model = future_map(future_map_dbl(K, ~stm(tweet_df_sparse, K = ., verbose = FALSE, .options = furrr_options(seed = T)))

Upvotes: 8

Related Questions