grf-labs / policytree

Policy learning via doubly robust empirical welfare maximization over trees
https://grf-labs.github.io/policytree/
MIT License
74 stars 15 forks source link

Including variable labels in the policy tree visualization #159

Open njawadekar opened 1 year ago

njawadekar commented 1 year ago

Based on existing documentation, I understand that when outputting a policy tree object into a visualization using the plot.policy_tree function, one can add the leaf.labels argument to ensure that the "treatment" or "control" recommendations will be labelled as such.

Similarly, how can one ensure that the variable labels (rather than the variable names) are output in this plot? (i.e., in the data visualization of the policy tree, I would like the variable "SBP" to appear as its corresponding label, "Systolic Blood Pressure").

erikcs commented 1 year ago

Hi @njawadekar, you can rename tree$columns to the names you prefer, then plot.