Combines multiple prediction tables (e.g., from different models or regions) into a single table. Supports weighted combination and collapsing regions.
Details
For classification, this function pools class-probability columns (`prob_*`) and returns pooled predicted class and correctness. For regression (numeric `observed`), it pools `predicted` values and returns residual diagnostics.
Examples
# Create example prediction tables
observed = factor(sample(letters[1:2], 10, replace = TRUE))
predtab1 <- data.frame(.rownum = 1:10,
roinum = rep(1, 10),
observed = observed,
prob_A = runif(10),
prob_B = runif(10))
predtab2 <- data.frame(.rownum = 1:10,
roinum = rep(2, 10),
observed = observed,
prob_A = runif(10),
prob_B = runif(10))
# Combine the tables
combined_table <- combine_prediction_tables(list(predtab1, predtab2))