结构主题模型 (STM) 错误:不可靠的值:未来('<none>')在未指定参数“种子”的情况下意外生成随机数

Lou*_*sD4 2 error-handling r topic-modeling topicmodels

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

\n
UNRELIABLE VALUE: Future (\xe2\x80\x98<none>\xe2\x80\x99) 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".\n
Run Code Online (Sandbox Code Playgroud)\n

这是我运行的代码:

\n
many_models <- data_frame(K = c(10, 20, 30, 40, 50, 60)) %>%\nmutate(topic_model = future_map_dbl(K, ~stm(tweet_df_sparse, K = .,\nverbose = FALSE)))\n
Run Code Online (Sandbox Code Playgroud)\n

知道如何快速修复它吗?

\n

ate*_*rst 6

需要将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)))
Run Code Online (Sandbox Code Playgroud)

  • 我喜欢 R,但是我怎么能知道 `.options = Furrr_options(seed = TRUE)` 是从上面的错误消息传递的正确参数呢? (3认同)