Skip to content

Commit a2f7a41

Browse files
spec: add tree-decision specification (#4599)
## New Specification: `tree-decision` Related to #4569 --- ### specification.md # tree-decision: Decision Tree Visualization with Probabilities ## Description A tree-structured diagram for sequential decision analysis, displaying decision nodes (squares), chance nodes (circles), and terminal outcome nodes (triangles) connected by branching paths. Each chance branch is labeled with probabilities, terminal nodes show payoff values, and Expected Monetary Values (EMV) are calculated via rollback at each node. Rejected (pruned) branches are visually marked, making it easy to trace the optimal decision path through a multi-stage problem. ## Applications - Business strategy: evaluating whether to launch a new product line by comparing investment options under uncertain market conditions - Medical decision-making: choosing between treatment pathways based on probability of outcomes and quality-adjusted life years - Project management: analyzing go/no-go decisions for R&D projects with uncertain technical success and market demand - Operations research: optimizing sequential decisions such as equipment replacement or capacity expansion under uncertainty ## Data - `node_id` (string) - unique identifier for each node in the tree - `node_type` (categorical: decision/chance/terminal) - the type of node determining its shape - `parent_id` (string) - identifier of the parent node (null for root) - `branch_label` (string) - label for the branch connecting to this node (option name or probability) - `probability` (float, 0-1) - probability assigned to chance branches (null for decision branches) - `payoff` (float) - monetary or utility value at terminal nodes - `emv` (float) - expected monetary value calculated via rollback at decision and chance nodes - `pruned` (boolean) - whether this branch is rejected in the optimal solution - Size: 10-30 nodes typical for a readable decision tree - Example: a two-stage investment decision — first choose to invest or not, then face uncertain outcomes (high/low demand) with associated probabilities and payoffs ## Notes - Decision nodes should be rendered as squares, chance nodes as circles, and terminal nodes as right-pointing triangles - Left-to-right layout is preferred for readability - Pruned branches should be marked with a double-strike or cross mark and rendered with reduced opacity or a dashed line - EMV values should be displayed inside or adjacent to each non-terminal node - Probabilities on chance branches should sum to 1.0 for each chance node - Use distinct colors for decision vs. chance nodes for quick visual identification - Branch labels for decision nodes should show option names; branch labels for chance nodes should show probability values --- **Next:** Add `approved` label to the issue to merge this PR. --- :robot: *[spec-create workflow](https://github.com/MarkusNeusinger/pyplots/actions/runs/22779511771)* Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 0c5692a commit a2f7a41

2 files changed

Lines changed: 60 additions & 0 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# tree-decision: Decision Tree Visualization with Probabilities
2+
3+
## Description
4+
5+
A tree-structured diagram for sequential decision analysis, displaying decision nodes (squares), chance nodes (circles), and terminal outcome nodes (triangles) connected by branching paths. Each chance branch is labeled with probabilities, terminal nodes show payoff values, and Expected Monetary Values (EMV) are calculated via rollback at each node. Rejected (pruned) branches are visually marked, making it easy to trace the optimal decision path through a multi-stage problem.
6+
7+
## Applications
8+
9+
- Business strategy: evaluating whether to launch a new product line by comparing investment options under uncertain market conditions
10+
- Medical decision-making: choosing between treatment pathways based on probability of outcomes and quality-adjusted life years
11+
- Project management: analyzing go/no-go decisions for R&D projects with uncertain technical success and market demand
12+
- Operations research: optimizing sequential decisions such as equipment replacement or capacity expansion under uncertainty
13+
14+
## Data
15+
16+
- `node_id` (string) - unique identifier for each node in the tree
17+
- `node_type` (categorical: decision/chance/terminal) - the type of node determining its shape
18+
- `parent_id` (string) - identifier of the parent node (null for root)
19+
- `branch_label` (string) - label for the branch connecting to this node (option name or probability)
20+
- `probability` (float, 0-1) - probability assigned to chance branches (null for decision branches)
21+
- `payoff` (float) - monetary or utility value at terminal nodes
22+
- `emv` (float) - expected monetary value calculated via rollback at decision and chance nodes
23+
- `pruned` (boolean) - whether this branch is rejected in the optimal solution
24+
- Size: 10-30 nodes typical for a readable decision tree
25+
- Example: a two-stage investment decision — first choose to invest or not, then face uncertain outcomes (high/low demand) with associated probabilities and payoffs
26+
27+
## Notes
28+
29+
- Decision nodes should be rendered as squares, chance nodes as circles, and terminal nodes as right-pointing triangles
30+
- Left-to-right layout is preferred for readability
31+
- Pruned branches should be marked with a double-strike or cross mark and rendered with reduced opacity or a dashed line
32+
- EMV values should be displayed inside or adjacent to each non-terminal node
33+
- Probabilities on chance branches should sum to 1.0 for each chance node
34+
- Use distinct colors for decision vs. chance nodes for quick visual identification
35+
- Branch labels for decision nodes should show option names; branch labels for chance nodes should show probability values
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
spec_id: tree-decision
2+
title: Decision Tree Visualization with Probabilities
3+
4+
# Specification tracking
5+
created: "2026-03-06T19:53:14Z"
6+
updated: null
7+
issue: 4569
8+
suggested: MarkusNeusinger
9+
10+
# Classification tags
11+
tags:
12+
plot_type:
13+
- tree
14+
- dendrogram
15+
data_type:
16+
- hierarchical
17+
- numeric
18+
- categorical
19+
domain:
20+
- business
21+
- finance
22+
features:
23+
- annotated
24+
- stepwise
25+
- comparison

0 commit comments

Comments
 (0)