2

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?

glts
  • 21,808
  • 12
  • 73
  • 94
LouisD4
  • 21
  • 2
  • I encountered the same issue. This link may help https://www.r-bloggers.com/2020/09/future-1-19-1-making-sure-proper-random-numbers-are-produced-in-parallel-processing/ – aterhorst Feb 03 '21 at 11:03

1 Answers1

5

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)))
aterhorst
  • 625
  • 4
  • 14
  • 3
    I love R, but how was I ever supposed to figure out that `.options = furrr_options(seed = TRUE)` was the right argument to pass from the above error message? – matmat Oct 21 '21 at 06:30
  • Did you pass it to `stm()` or `future_map()`? – dzegpi Apr 19 '23 at 14:50