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,
spend_levels = c(0.1, 0.4),
label_mapping = NULL,
original_df = NULL,
model_names = NULL,
output_objects = c("policy_tree", "decision_tree", "combined_plot", "qini_plot",
"diff_gain_summaries"),
qini_args = list(),
baseline_method = "maq_no_covariates",
seed = 12345
)
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.
- spend_levels
Numeric vector of spend levels for difference-gain summaries. Default:
0.1
.- 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.
- qini_args
List of additional arguments to pass to margot_plot_qini(). Default: list().
- baseline_method
Method for generating baseline: "maq_no_covariates" (default), "auto", "simple", "maq_only", or "none". See details in margot_generate_qini_data().
- seed
Integer. Random seed for reproducibility in QINI computations (default 12345).