Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Decision Tree (CART-like) + Tkinter Visualizer

image

Overview

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).


Features

Decision Tree

  • Supports binary splits:
    • Numeric features: feature <= threshold
    • Categorical features: feature == value vs != value (one-vs-rest)
  • Works with binary and multi-class targets
  • Split criterion: Gini impurity
  • Includes basic stopping rules:
    • max_depth
    • min_samples_split
    • pure nodes (gini == 0)

GUI Tree Viewer (Tkinter)

  • Draws nodes as rectangles
  • Draws edges as straight white lines
  • Zoom in/out:
    • Ctrl + MouseWheel (Windows/macOS)
    • Ctrl + Button-4 / Button-5 (Linux)

About

A simple decision tree classfier Cart-Like style with numpy and pandas.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages