Reduce one prediction block per branch (each from a different producer/model) into a single
fused block under merge_node, keyed by sample_id. This is the cross-branch analogue of
reduce_predictions_across_folds: where that joins folds of one producer, this joins branches
of one merge point. Asymmetric-branch fusion is intrinsic — a modelless branch simply emits no
PredictionBlock, so it is absent from branch_blocks and contributes nothing. A sample is
averaged over exactly the model-bearing branches that predicted it (its branch coverage), never
over a fixed denominator, so partial coverage does not silently down-weight a sample. The join is
identity-keyed and the union sample order is first-seen; positional joins are never used.
Reduce per-fold prediction blocks (same producer + partition) into one block, keyed by
sample_id — the native cross-fold ensemble dag-ml previously lacked. A sample that appears in
exactly one fold (the disjoint OOF/validation case) passes through unchanged (mean-of-one); a
sample predicted by several folds (the shared train/test case) is (weighted) averaged. avg =
no weights; w_avg = per-fold weights (e.g. 1/shifted_val_rmse). First-seen sample order is
preserved; the join is identity-keyed, never positional.
Probability-mean fusion for classification: average per-class probability rows across branches,
keyed by sample_id, under merge_node. Each row of every branch block is treated as a
probability vector over the same width classes; rows must be finite, non-negative and sum to
1 (within PROBA_SUM_TOLERANCE). Like reduce_predictions_across_branches this is
asymmetric-branch safe — modelless branches contribute no block — and each sample is averaged
only over the branches that predicted it. The fused rows are renormalized so each output row is
itself a valid probability distribution (it already sums to 1 under equal per-branch weight, but
renormalization keeps the contract exact under floating-point and partial coverage).