-
Consider this example, where I have a complete pipeline factory called Currently, if My desired solution here would be something like this:
This would invoke the pipeline 3 times. Normally this would clobber the metadata, but because the pipeline is set up such that each individual Is this -- or something equivalent -- possible? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
I recommend other strategies such as batching, maybe multiple labels per target. Sketch with 10 reps within 10 batches: # _targets.R
library(targets)
library(tarchetypes)
library(tibble)
list(
tar_group_by(
label_df,
tibble(
labels = sprintf("label%s", seq_len(100)),
batch_id = rep(seq_len(10), each = 10)
),
batch_id
),
tar_target(
per_batch,
apply(label_df, 1, length), # Loop over the rows to do something for each label within batch.
pattern = map(label_df) # One dynamic branch target per batch.
)
) As explained at https://books.ropensci.org/targets/practices.html#how-to-define-good-targets, there are tradeoffs in terms of how work is divided up, and it can slow things down to have a lot of targets that each do a small piece of the work. Does that mean If you want to split up the work across multiple pipelines, they should have separate |
Beta Was this translation helpful? Give feedback.
I recommend other strategies such as batching, maybe multiple labels per target. Sketch with 10 reps within 10 batches:
As explained at https://books.ropensci.org/targets/practices.html#how-to-define-good-targets, there are tradeoffs in terms of how work is divid…