pytyche.viz.plot_policy_tree

pytyche.viz.plot_policy_tree(tree_policy, ax=None)[source]

Render the fitted policy tree as a policy, not a classifier.

Split nodes show only their condition (extraction-adapter feature names — the encoding the tree was fit on). Leaves show the policy content: the leading treatment with its Thompson allocation weight, the remaining allocation, and the segment’s population share and stability score. Each leaf box is filled as a stacked bar — one band per arm, width proportional to that arm’s Thompson share, one color per arm consistent across leaves (legend on the axes); sklearn’s classifier-style samples/value arrays never appear.

Parameters:
Return type:

Axes

Returns:

The axes containing the rendered tree-node annotations.