Batch process policy tree interpretations
Source:R/margot_interpret_policy_batch.R
margot_interpret_policy_batch.Rd
Usage
margot_interpret_policy_batch(
models,
model_names = NULL,
max_depth = 2L,
save_path = NULL,
prefix = NULL,
include_timestamp = FALSE,
report_policy_value = c("none", "treat_all", "control_all", "both", "treated_only"),
policy_value_R = 499L,
policy_value_seed = 42L,
policy_value_ci_level = 0.95,
brief = FALSE,
brief_save_to = NULL,
return_as_list = FALSE,
...
)
Arguments
- models
A list containing the results from multi-arm causal forest models.
- model_names
A character vector of model names to interpret. If NULL, all models are processed.
- max_depth
Integer, 1 or 2; which saved policy tree to interpret (default 2).
- save_path
The path where the combined interpretation will be saved. If NULL, nothing is saved.
- prefix
An optional prefix for the filename.
- include_timestamp
Logical; whether to include a timestamp in the filename (if desired).
- report_policy_value
Character: one of "none" (default), "treat_all", "control_all", or "both". If not "none", each model interpretation will include a one-line policy value summary with 95
policy_value_RInteger >= 199; bootstrap replicates (default 499).
policy_value_seedInteger or NULL; RNG seed (default 42).
policy_value_ci_levelNumeric confidence level (default 0.95).
briefLogical; if TRUE, prepend a compact treated-only summary for each model (coverage treated and average uplift among treated) and optionally save it.
brief_save_toOptional path to save the brief treated-only summary as text.
...Additional arguments to pass to margot_interpret_policy_tree(), including include_conditional_means (default TRUE), use_math_notation (default FALSE), output_format ("bullet" or "prose"), original_df, label_mapping, and policy value options.
A single character string containing the combined markdown output. This function now accepts a vector of model names to process and produces a single combined output. The common description is printed once at the top, followed by each model's specific findings. You can now control whether to interpret the depth-1 or depth-2 tree via the `max_depth` argument.