This project contains a simple CART-style Decision Tree classifier implemented from scratch in Python, plus a Tkinter GUI viewer that renders the tree as a graph with:
- Black background
- White square nodes and edges
- White text
- Mouse-wheel zoom (Ctrl + wheel by default)
The goal is to keep the implementation clear and educational, while still being reasonably efficient (especially for numeric splits).
- Supports binary splits:
- Numeric features:
feature <= threshold - Categorical features:
feature == valuevs!= value(one-vs-rest)
- Numeric features:
- Works with binary and multi-class targets
- Split criterion: Gini impurity
- Includes basic stopping rules:
max_depthmin_samples_split- pure nodes (
gini == 0)
- Draws nodes as rectangles
- Draws edges as straight white lines
- Zoom in/out:
Ctrl + MouseWheel(Windows/macOS)Ctrl + Button-4 / Button-5(Linux)