# bharanidharanv26/aimllab architecture

> Architecture diagram of the GitHub repository bharanidharanv26/aimllab, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bharanidharanv26/aimllab
- Repository: https://github.com/bharanidharanv26/aimllab

## Overview

This repository is a set of standalone educational Python demos rather than one integrated application. Users run a script to see its result: A* search finds a path, Tic-Tac-Toe plays against a minimax computer opponent, and three machine-learning scripts train and assess regression or classification models. The ML demos include dataset inspection, visualization, and model comparison where implemented. The source excerpts show each script’s internal flow; no README documents additional capabilities.

Main entry points: [`ex2.py`](https://github.com/bharanidharanv26/aimllab/blob/main/ex2.py) (Game Loop), [`ex4.py`](https://github.com/bharanidharanv26/aimllab/blob/main/ex4.py) (Iris Data Prep), [`ex5.py`](https://github.com/bharanidharanv26/aimllab/blob/main/ex5.py) (Iris Data Prep), [`ex3.py`](https://github.com/bharanidharanv26/aimllab/blob/main/ex3.py) (Housing Data Prep)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_search["Pathfinding Demo"]
  node_astar["A* Search<br/>[ex1.py]"]
  node_path["Path Reconstruction<br/>[ex1.py]"]
end

subgraph group_game["Game Demo"]
  node_game_loop["Game Loop<br/>[ex2.py]"]
  node_board["Board Display<br/>[ex2.py]"]
  node_winner["Win And Draw Checks<br/>[ex2.py]"]
  node_minimax["Minimax Search<br/>[ex2.py]"]
  node_computer["Computer Move<br/>[ex2.py]"]
end

subgraph group_ml["ML Demos"]
  node_housing_analysis["Housing Data Prep<br/>[ex3.py]"]
  node_regression["Regression Models<br/>[ex3.py]"]
  node_regression_eval["Regression Evaluation<br/>[ex3.py]"]
  node_regression_compare["Model Comparison<br/>[ex3.py]"]
  node_iris_tree["Iris Data Prep<br/>[ex4.py]"]
  node_tree_model["Decision Tree<br/>[ex4.py]"]
  node_forest_model["Random Forest<br/>[ex4.py]"]
  node_tree_compare["Classifier Comparison<br/>[ex4.py]"]
  node_iris_svm["Iris Data Prep<br/>[ex5.py]"]
  node_svm_train["SVM Training<br/>[ex5.py]"]
  node_svm_eval["SVM Evaluation<br/>[ex5.py]"]
  node_svm_visual["Boundary Visualization<br/>[ex5.py]"]
end

node_user(("Script User"))
node_housing_csv["Housing CSV"]

node_user -->|"runs"| node_astar
node_astar -->|"reconstructs path"| node_path
node_user -->|"plays"| node_game_loop
node_game_loop -->|"displays"| node_board
node_game_loop -->|"checks outcome"| node_winner
node_game_loop -->|"requests move"| node_computer
node_computer -->|"scores moves"| node_minimax
node_minimax -->|"checks outcome"| node_winner
node_housing_csv -->|"loads data"| node_housing_analysis
node_user -->|"runs"| node_housing_analysis
node_housing_analysis -->|"prepares features"| node_regression
node_regression -->|"predicts and scores"| node_regression_eval
node_regression_eval -->|"compares metrics"| node_regression_compare
node_user -->|"runs"| node_iris_tree
node_iris_tree -->|"trains and predicts"| node_tree_model
node_iris_tree -->|"trains and predicts"| node_forest_model
node_tree_model -->|"reports accuracy"| node_tree_compare
node_forest_model -->|"reports accuracy"| node_tree_compare
node_user -->|"runs"| node_iris_svm
node_iris_svm -->|"prepares features"| node_svm_train
node_svm_train -->|"predicts and scores"| node_svm_eval
node_iris_svm -->|"prepares plot data"| node_svm_visual
node_svm_train -->|"supplies support vectors"| node_svm_visual

click node_astar "https://github.com/bharanidharanv26/aimllab/blob/main/ex1.py"
click node_path "https://github.com/bharanidharanv26/aimllab/blob/main/ex1.py"
click node_game_loop "https://github.com/bharanidharanv26/aimllab/blob/main/ex2.py"
click node_board "https://github.com/bharanidharanv26/aimllab/blob/main/ex2.py"
click node_winner "https://github.com/bharanidharanv26/aimllab/blob/main/ex2.py"
click node_minimax "https://github.com/bharanidharanv26/aimllab/blob/main/ex2.py"
click node_computer "https://github.com/bharanidharanv26/aimllab/blob/main/ex2.py"
click node_housing_analysis "https://github.com/bharanidharanv26/aimllab/blob/main/ex3.py"
click node_regression "https://github.com/bharanidharanv26/aimllab/blob/main/ex3.py"
click node_regression_eval "https://github.com/bharanidharanv26/aimllab/blob/main/ex3.py"
click node_regression_compare "https://github.com/bharanidharanv26/aimllab/blob/main/ex3.py"
click node_iris_tree "https://github.com/bharanidharanv26/aimllab/blob/main/ex4.py"
click node_tree_model "https://github.com/bharanidharanv26/aimllab/blob/main/ex4.py"
click node_forest_model "https://github.com/bharanidharanv26/aimllab/blob/main/ex4.py"
click node_tree_compare "https://github.com/bharanidharanv26/aimllab/blob/main/ex4.py"
click node_iris_svm "https://github.com/bharanidharanv26/aimllab/blob/main/ex5.py"
click node_svm_train "https://github.com/bharanidharanv26/aimllab/blob/main/ex5.py"
click node_svm_eval "https://github.com/bharanidharanv26/aimllab/blob/main/ex5.py"
click node_svm_visual "https://github.com/bharanidharanv26/aimllab/blob/main/ex5.py"

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_astar,node_path,node_user toneBlue
class node_game_loop,node_board,node_winner,node_minimax,node_computer toneAmber
class node_housing_analysis,node_regression,node_regression_eval,node_regression_compare,node_iris_tree,node_tree_model,node_forest_model,node_tree_compare,node_iris_svm,node_svm_train,node_svm_eval,node_svm_visual toneMint
class node_housing_csv toneIndigo
```

## Components

### Pathfinding Demo

- [A* Search](https://github.com/bharanidharanv26/aimllab/blob/main/ex1.py): `ex1.py`
- [Path Reconstruction](https://github.com/bharanidharanv26/aimllab/blob/main/ex1.py): `ex1.py`

### Game Demo

- [Game Loop](https://github.com/bharanidharanv26/aimllab/blob/main/ex2.py): `ex2.py`
- [Board Display](https://github.com/bharanidharanv26/aimllab/blob/main/ex2.py): `ex2.py`
- [Win And Draw Checks](https://github.com/bharanidharanv26/aimllab/blob/main/ex2.py): `ex2.py`
- [Minimax Search](https://github.com/bharanidharanv26/aimllab/blob/main/ex2.py): `ex2.py`
- [Computer Move](https://github.com/bharanidharanv26/aimllab/blob/main/ex2.py): `ex2.py`

### ML Demos

- [Housing Data Prep](https://github.com/bharanidharanv26/aimllab/blob/main/ex3.py): `ex3.py`
- [Regression Models](https://github.com/bharanidharanv26/aimllab/blob/main/ex3.py): `ex3.py`
- [Regression Evaluation](https://github.com/bharanidharanv26/aimllab/blob/main/ex3.py): `ex3.py`
- [Model Comparison](https://github.com/bharanidharanv26/aimllab/blob/main/ex3.py): `ex3.py`
- [Iris Data Prep](https://github.com/bharanidharanv26/aimllab/blob/main/ex4.py): `ex4.py`
- [Decision Tree](https://github.com/bharanidharanv26/aimllab/blob/main/ex4.py): `ex4.py`
- [Random Forest](https://github.com/bharanidharanv26/aimllab/blob/main/ex4.py): `ex4.py`
- [Classifier Comparison](https://github.com/bharanidharanv26/aimllab/blob/main/ex4.py): `ex4.py`
- [Iris Data Prep](https://github.com/bharanidharanv26/aimllab/blob/main/ex5.py): `ex5.py`
- [SVM Training](https://github.com/bharanidharanv26/aimllab/blob/main/ex5.py): `ex5.py`
- [SVM Evaluation](https://github.com/bharanidharanv26/aimllab/blob/main/ex5.py): `ex5.py`
- [Boundary Visualization](https://github.com/bharanidharanv26/aimllab/blob/main/ex5.py): `ex5.py`

### Other components

- **Script User**
- **Housing CSV**

## Connections

- Script User → A* Search: runs (evidence: `ex1.py`)
- A* Search → Path Reconstruction: reconstructs path (evidence: `ex1.py`)
- Script User → Game Loop: plays (evidence: `ex2.py`)
- Game Loop → Board Display: displays (evidence: `ex2.py`)
- Game Loop → Win And Draw Checks: checks outcome (evidence: `ex2.py`)
- Game Loop → Computer Move: requests move (evidence: `ex2.py`)
- Computer Move → Minimax Search: scores moves (evidence: `ex2.py`)
- Minimax Search → Win And Draw Checks: checks outcome (evidence: `ex2.py`)
- Housing CSV → Housing Data Prep: loads data (evidence: `ex3.py`)
- Script User → Housing Data Prep: runs (evidence: `ex3.py`)
- Housing Data Prep → Regression Models: prepares features (evidence: `ex3.py`)
- Regression Models → Regression Evaluation: predicts and scores (evidence: `ex3.py`)
- Regression Evaluation → Model Comparison: compares metrics (evidence: `ex3.py`)
- Script User → Iris Data Prep: runs (evidence: `ex4.py`)
- Iris Data Prep → Decision Tree: trains and predicts (evidence: `ex4.py`)
- Iris Data Prep → Random Forest: trains and predicts (evidence: `ex4.py`)
- Decision Tree → Classifier Comparison: reports accuracy (evidence: `ex4.py`)
- Random Forest → Classifier Comparison: reports accuracy (evidence: `ex4.py`)
- Script User → Iris Data Prep: runs (evidence: `ex5.py`)
- Iris Data Prep → SVM Training: prepares features (evidence: `ex5.py`)
- SVM Training → SVM Evaluation: predicts and scores (evidence: `ex5.py`)
- Iris Data Prep → Boundary Visualization: prepares plot data (evidence: `ex5.py`)
- SVM Training → Boundary Visualization: supplies support vectors (evidence: `ex5.py`)
