Tidymodel - Recipe equivalent

What is the equivalent of the code below in the recipe package #tidymodels ?

df %>%
  group_by(state, month) %>%
  mutate_at(vars(-group_cols()), ~replace(., is.na(.), median(., na.rm = TRUE)))

I've searched the recipe reference page but haven't found how do I replace the NA's with the median grouped by each month/state

Well, Max Kuhn answered me in twitter and said grouped imputation isn't supported yet.

He suggested me using bagged imputation or knn, thx.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.