1

成功运行我的 stm 几次后,我现在每次尝试运行它时都会收到此错误消息:

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".

这是我运行的代码:

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)))

知道如何快速修复它吗?

4

1 回答 1

2

需要将 seed = TRUE 添加到 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)))
于 2021-02-03T11:52:04.523 回答