R - Parallelizing multiple model learning (with dplyr and purrr)

前端 未结 2 920
眼角桃花
眼角桃花 2021-02-05 12:19

This is a follow up to a previous question about learning multiple models.

The use case is that I have multiple observations for each subject, and I want to train a mode

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-05 12:33

    There is the furrr package now, for example something like:

    library(dplyr)
    library(furrr)
    plan(multiprocess)
    
    dt %>% 
        split(dt$subject_id) %>%
        future_map(~fitdist(.$observation, "norm"))
    

提交回复
热议问题