# m4444sa/tic-tac-toe-tree architecture

> Architecture diagram of the GitHub repository m4444sa/tic-tac-toe-tree, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/m4444sa/tic-tac-toe-tree
- Repository: https://github.com/m4444sa/tic-tac-toe-tree

## Overview

This is a single-notebook machine-learning study that classifies completed Tic-Tac-Toe boards as X wins or not. Its documented workflow loads the UCI dataset, splits it, one-hot encodes board positions, and compares a decision tree, random forest, and XGBoost; decision-tree depth is chosen using validation accuracy. The notebook also manually calculates entropy and information gain. Source excerpts were unavailable, so links reflect README-documented workflow only.

Main entry points: [`tic-tac-toe-tree.ipynb`](https://github.com/m4444sa/tic-tac-toe-tree/blob/main/tic-tac-toe-tree.ipynb) (One-hot encoding)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_reader(("Notebook user"))
node_uci[("UCI endgame data")]
node_split["Data split"]
node_encoding["One-hot encoding"]
node_information["Entropy and gain"]
node_tree["Decision tree"]
node_forest["Random forest"]
node_xgboost["XGBoost"]
node_selection["Depth selection"]
node_comparison["Model comparison"]

node_reader -->|"opens notebook"| node_split
node_uci -->|"provides boards"| node_split
node_split -->|"passes data"| node_encoding
node_encoding -->|"provides features"| node_information
node_encoding -->|"provides features"| node_tree
node_encoding -->|"provides features"| node_forest
node_encoding -->|"provides features"| node_xgboost
node_tree -->|"tests depths"| node_selection
node_selection -->|"provides selected tree"| node_comparison
node_forest -->|"provides model"| node_comparison
node_xgboost -->|"provides model"| node_comparison

click node_split "https://github.com/m4444sa/tic-tac-toe-tree/blob/main/tic-tac-toe-tree.ipynb"
click node_encoding "https://github.com/m4444sa/tic-tac-toe-tree/blob/main/tic-tac-toe-tree.ipynb"
click node_information "https://github.com/m4444sa/tic-tac-toe-tree/blob/main/tic-tac-toe-tree.ipynb"
click node_tree "https://github.com/m4444sa/tic-tac-toe-tree/blob/main/tic-tac-toe-tree.ipynb"
click node_forest "https://github.com/m4444sa/tic-tac-toe-tree/blob/main/tic-tac-toe-tree.ipynb"
click node_xgboost "https://github.com/m4444sa/tic-tac-toe-tree/blob/main/tic-tac-toe-tree.ipynb"
click node_selection "https://github.com/m4444sa/tic-tac-toe-tree/blob/main/tic-tac-toe-tree.ipynb"
click node_comparison "https://github.com/m4444sa/tic-tac-toe-tree/blob/main/tic-tac-toe-tree.ipynb"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_reader toneBlue
class node_uci toneAmber
class node_split,node_encoding,node_information,node_tree,node_forest,node_xgboost,node_selection toneTeal
class node_comparison toneIndigo
```

## Components

### Other components

- **Notebook user**
- **UCI endgame data**
- [Data split](https://github.com/m4444sa/tic-tac-toe-tree/blob/main/tic-tac-toe-tree.ipynb): `tic-tac-toe-tree.ipynb`
- [One-hot encoding](https://github.com/m4444sa/tic-tac-toe-tree/blob/main/tic-tac-toe-tree.ipynb): `tic-tac-toe-tree.ipynb`
- [Entropy and gain](https://github.com/m4444sa/tic-tac-toe-tree/blob/main/tic-tac-toe-tree.ipynb): `tic-tac-toe-tree.ipynb`
- [Decision tree](https://github.com/m4444sa/tic-tac-toe-tree/blob/main/tic-tac-toe-tree.ipynb): `tic-tac-toe-tree.ipynb`
- [Random forest](https://github.com/m4444sa/tic-tac-toe-tree/blob/main/tic-tac-toe-tree.ipynb): `tic-tac-toe-tree.ipynb`
- [XGBoost](https://github.com/m4444sa/tic-tac-toe-tree/blob/main/tic-tac-toe-tree.ipynb): `tic-tac-toe-tree.ipynb`
- [Depth selection](https://github.com/m4444sa/tic-tac-toe-tree/blob/main/tic-tac-toe-tree.ipynb): `tic-tac-toe-tree.ipynb`
- [Model comparison](https://github.com/m4444sa/tic-tac-toe-tree/blob/main/tic-tac-toe-tree.ipynb): `tic-tac-toe-tree.ipynb`

## Connections

- Notebook user → Data split: opens notebook
- UCI endgame data → Data split: provides boards
- Data split → One-hot encoding: passes data
- One-hot encoding → Entropy and gain: provides features
- One-hot encoding → Decision tree: provides features
- One-hot encoding → Random forest: provides features
- One-hot encoding → XGBoost: provides features
- Decision tree → Depth selection: tests depths
- Depth selection → Model comparison: provides selected tree
- Random forest → Model comparison: provides model
- XGBoost → Model comparison: provides model
