Software

Hongying Li, Li Li, and I jointly develop and maintain the targetree package, which is available in Python, R, and Stata.

targetree helps empirical researchers construct, evaluate, and visualize interpretable binary classification trees for policy targeting. The three implementations provide a common workflow for fitting CART, PFS, and MDFS trees and presenting the resulting targeting policies.

What targetree produces

The figure below illustrates the package’s main output: an interpretable targeting policy constructed from a fitted classification tree. At each internal node, the left branch satisfies the displayed condition and the right branch does not. Each terminal node reports the subgroup’s estimated outcome probability, $\hat{\mu}$, and sample size, $N$. Blue terminal nodes are targeted because their estimated probabilities exceed the policy threshold of 0.35; white terminal nodes are not targeted.

MDFS targeting policy shown as a binary tree. Internal nodes contain split rules, and blue terminal nodes identify subgroups with estimated outcome probabilities above 0.35.
Example targeting policy constructed using MDFS. Select the figure to open the full-resolution PDF.