Batch Processing of Policy Trees and Related Visualisations
Source:R/margot_policy.R
margot_policy.Rd
Process a list of multi-arm causal forest results: generate policy-tree and decision-tree plots, Qini curves, and difference-gain summaries. Users can toggle which outputs to include via the `output_objects` parameter.
Usage
margot_policy(
result_outcomes,
policy_tree_args = list(),
decision_tree_args = list(),
max_depth = 2L,
dpi = 600,
width = 12,
height = 12,
save_plots = TRUE,
output_dir = here::here(push_mods),
spend = c(0.2, 0.5),
label_mapping = NULL,
original_df = NULL,
model_names = NULL,
output_objects = c("policy_tree", "decision_tree", "combined_plot", "qini_plot",
"diff_gain_summaries")
)
Arguments
- result_outcomes
List returned by
margot_multi_arm_causal_forest()
.- policy_tree_args
List of args for
margot_plot_policy_tree()
. Default:list()
.- decision_tree_args
List of args for
margot_plot_decision_tree()
. Default:list()
.- max_depth
Integer, 1 or 2; which decision tree depth to plot. Default: 2.
- dpi
Resolution (dpi) for saved plots. Default: 600.
- width
Width (in inches) for saved plots. Default: 12.
- height
Height (in inches) for saved plots. Default: 12.
- save_plots
Logical; save plots to disk? Default: TRUE.
- output_dir
Directory for saving plots. Default:
here::here(push_mods)
.- spend
Numeric vector of spend levels for difference-gain summaries. Default:
c(0.2, 0.5)
.- label_mapping
Named list mapping variable names to display labels. Default: NULL.
- original_df
Optional data.frame of untransformed variables for axis annotations. Default: NULL.
- model_names
Character vector of model names to process; NULL = all. Default: NULL.
- output_objects
Character vector specifying which outputs to include. Options: "policy_tree", "decision_tree", "combined_plot", "qini_plot", "diff_gain_summaries". Default: all.