Skip to content
Graphviz (DOT) templates

Decision Tree

Decision tree rendered via Graphviz DOT for clean splits.

Template previewGraphviz (DOT)
DecisionTree root Age >= 30? a Income >= 60k? root->a yes b Owns house? root->b no l1 Approve a->l1 yes l2 Review a->l2 no l3 Approve b->l3 yes l4 Reject b->l4 no

What this template contains

Graph
Directed
Edges
6
Source
17 lines

Make it your own.

digraph DecisionTree {
  rankdir=TB;
  node [shape=box, style="rounded,filled", fillcolor="#eef4ff", fontname="Inter"];
  root [label="Age >= 30?", fillcolor="#fde68a"];
  a   [label="Income >= 60k?"];
  b   [label="Owns house?"];
  l1  [label="Approve", fillcolor="#bbf7d0"];
  l2  [label="Review", fillcolor="#fde68a"];
  l3  [label="Approve", fillcolor="#bbf7d0"];
  l4  [label="Reject", fillcolor="#fecaca"];
  root -> a [label="yes"];
  root -> b [label="no"];
  a -> l1 [label="yes"];
  a -> l2 [label="no"];
  b -> l3 [label="yes"];
  b -> l4 [label="no"];
}