# amityadav08/ml_projects_submission architecture

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

- Interactive diagram: https://gitdiagram.com/amityadav08/ml_projects_submission
- Repository: https://github.com/amityadav08/ml_projects_submission

## Overview

1. **Repository shape**
   This is a portfolio-style monorepo of **independent machine learning exercises**, not a single integrated application. Each project lives in its own top-level folder, with its own script, data, and README. There is **no shared library layer or cross-project runtime coupling**.

2. **Top-level structure**
   The root contains a global `README.md` describing the portfolio, plus a `metrics/metrics_summary.csv` file that acts as a **lightweight results index** across projects. The rest of the repo is split into `Project2_...` through `Project8_...`, each representing a separate analytical pipeline.

3. **Common project pattern**
   Most projects follow the same architecture:  
   **input data in `data/` → single Python entry script → model/analysis output**.  
   The Python files are the primary executable artifacts, and the bundled data files are local datasets rather than remote services or databases.

4. **Project 2: GDP vs CO2 analysis**
   `gdp_analysis.py` is an **exploratory data analysis** pipeline over World Bank-style indicator data (`Indicators.bz2`). It focuses on pandas-based data wrangling, correlation analysis, and visualization. This project is **analysis-only**; it does not produce a predictive model.

5. **Project 3: Geographic overlays**
   `geo_visualization.py` combines indicator data with `world-countries.json` to generate **interactive choropleth maps** using Folium. The important boundary here is between tabular indicators and geographic geometry: the script joins them to create a browser-rendered map artifact rather than a numeric model.

6. **Projects 4 and 8: sentiment classification**
   Both sentiment projects consume the same text corpus format (`full_set.txt`) but use different classifiers:
   - **Project 4**: logistic regression with text preprocessing and feature extraction
   - **Project 8**: support vector machine classification with tuning/validation  
   The shared architectural pattern is **NLP preprocessing → bag-of-words/CountVectorizer-style features → supervised classifier → accuracy/error reporting**.

7. **Project 5: weather decision tree**
   `weather_classifier.py` reads `data_weather.csv` and builds a **binary classification** workflow with a decision tree. The key boundary is feature selection from morning measurements into a supervised prediction target. This is a classic tabular ML pipeline with model evaluation built in.

8. **Project 6: handwritten digit recognition**
   `digit_recognition.py` uses NumPy arrays (`train_data.npy`, `train_labels.npy`, `test_data.npy`, `test_labels.npy`) for **image classification with K-nearest neighbors**. The architecture here is data-array driven rather than CSV/text based, and the workflow depends on distance-based classification over flattened image vectors.

9. **Project 7: weather clustering**
   `weather_clustering.py` uses `weather.zip` as the input source for an **unsupervised learning** pipeline. Unlike the classification projects, there is no label boundary; the script groups observations using K-means and evaluates structure with cluster-quality metrics such as inertia and silhouette score.

10. **Shared tooling and libraries**
    Across the repo, the dominant runtime is **Python** with **pandas, NumPy, scikit-learn, matplotlib, and Folium**. The repository emphasizes local, file-based execution rather than services, APIs, or notebooks. Model selection, evaluation, and visualization are embedded in the individual scripts.

11. **Data flow boundary**
    Data is always stored **inside each project folder**, which keeps each experiment self-contained. Inputs are read from the project’s `data/` directory, transformed in-memory, and then either visualized, classified, or clustered. There is no central data warehouse or shared preprocessing service.

12. **What an architecture diagram should show**
    A useful diagram would depict:
    - a **root portfolio layer**
    - seven **isolated project pipelines**
    - per-project **local datasets**
    - per-project **single Python execution units**
    - outputs split into **visualizations, model metrics, or interactive map artifacts**
    - a small **cross-project metrics summary** at the root  
    The main architectural idea is independence: each folder is a standalone ML experiment with its own data modality and algorithmic focus.

Main entry points: [`README.md`](https://github.com/amityadav08/ml_projects_submission/blob/main/README.md) (Portfolio), [`metrics/metrics_summary.csv`](https://github.com/amityadav08/ml_projects_submission/blob/main/metrics/metrics_summary.csv) (Metrics CSV), [`Project2_GDP_CO2_Analysis`](https://github.com/amityadav08/ml_projects_submission/tree/main/Project2_GDP_CO2_Analysis) (GDP vs CO2), [`Project5_Weather_DecisionTree`](https://github.com/amityadav08/ml_projects_submission/tree/main/Project5_Weather_DecisionTree) (Weather tree)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_root["Portfolio"]
  node_repo_root["Portfolio<br/>root<br/>[README.md]"]
end

subgraph group_tabular["Tabular ML"]
  node_p2["GDP vs CO2"]
  node_p2_data[("Indicator data<br/>dataset<br/>[Indicators.bz2]")]
  node_p2_script["EDA script<br/>analysis script<br/>[gdp_analysis.py]"]
  node_p5["Weather tree"]
  node_p5_data[("Weather CSV<br/>tabular dataset<br/>[data_weather.csv]")]
  node_p5_script["Tree script<br/>classifier script"]
  node_p7["Weather KMeans"]
  node_p7_data[("Weather zip<br/>dataset<br/>[weather.zip]")]
  node_p7_script["KMeans script<br/>clustering script"]
end

subgraph group_geo["Geospatial"]
  node_p3["Geo overlays"]
  node_p3_data[("Geo data<br/>spatial data")]
  node_p3_script["Map script<br/>visualization script"]
end

subgraph group_nlp["Text ML"]
  node_p4["Sentiment LR"]
  node_p4_data["Text corpus<br/>text dataset<br/>[full_set.txt]"]
  node_p4_script["LR script<br/>classifier script"]
  node_p8["Sentiment SVM"]
  node_p8_data["Text corpus<br/>text dataset<br/>[full_set.txt]"]
  node_p8_script["SVM script<br/>classifier script<br/>[svm_classifier.py]"]
end

subgraph group_vision["Image ML"]
  node_p6["Digit KNN"]
  node_p6_data[("Digit arrays<br/>array dataset")]
  node_p6_script["KNN script<br/>classifier script"]
end

subgraph group_reporting["Reporting"]
  node_metrics_summary["Metrics CSV<br/>summary index"]
end

node_repo_root -->|"indexes"| node_metrics_summary
node_repo_root -->|"contains"| node_p2
node_p2 -->|"reads"| node_p2_data
node_p2 -->|"executes"| node_p2_script
node_p2_script -.->|"contributes"| node_metrics_summary
node_repo_root -->|"contains"| node_p3
node_p3 -->|"reads"| node_p3_data
node_p3 -->|"executes"| node_p3_script
node_p3_script -.->|"joins"| node_p3_data
node_repo_root -->|"contains"| node_p4
node_p4 -->|"reads"| node_p4_data
node_p4 -->|"executes"| node_p4_script
node_p4_script -.->|"reports"| node_metrics_summary
node_repo_root -->|"contains"| node_p5
node_p5 -->|"reads"| node_p5_data
node_p5 -->|"executes"| node_p5_script
node_p5_script -.->|"reports"| node_metrics_summary
node_repo_root -->|"contains"| node_p6
node_p6 -->|"reads"| node_p6_data
node_p6 -->|"executes"| node_p6_script
node_p6_script -.->|"reports"| node_metrics_summary
node_repo_root -->|"contains"| node_p7
node_p7 -->|"reads"| node_p7_data
node_p7 -->|"executes"| node_p7_script
node_p7_script -.->|"reports"| node_metrics_summary
node_repo_root -->|"contains"| node_p8
node_p8 -->|"reads"| node_p8_data
node_p8 -->|"executes"| node_p8_script
node_p8_script -.->|"reports"| node_metrics_summary

click node_repo_root "https://github.com/amityadav08/ml_projects_submission/blob/main/README.md"
click node_metrics_summary "https://github.com/amityadav08/ml_projects_submission/blob/main/metrics/metrics_summary.csv"
click node_p2 "https://github.com/amityadav08/ml_projects_submission/tree/main/Project2_GDP_CO2_Analysis"
click node_p2_data "https://github.com/amityadav08/ml_projects_submission/blob/main/Project2_GDP_CO2_Analysis/data/Indicators.bz2"
click node_p2_script "https://github.com/amityadav08/ml_projects_submission/blob/main/Project2_GDP_CO2_Analysis/gdp_analysis.py"
click node_p3 "https://github.com/amityadav08/ml_projects_submission/tree/main/Project3_GeoOverlays"
click node_p3_data "https://github.com/amityadav08/ml_projects_submission/tree/main/Project3_GeoOverlays/data"
click node_p3_script "https://github.com/amityadav08/ml_projects_submission/blob/main/Project3_GeoOverlays/geo_visualization.py"
click node_p4 "https://github.com/amityadav08/ml_projects_submission/tree/main/Project4_Sentiment_Logistic"
click node_p4_data "https://github.com/amityadav08/ml_projects_submission/blob/main/Project4_Sentiment_Logistic/data/full_set.txt"
click node_p4_script "https://github.com/amityadav08/ml_projects_submission/blob/main/Project4_Sentiment_Logistic/sentiment_analysis.py"
click node_p5 "https://github.com/amityadav08/ml_projects_submission/tree/main/Project5_Weather_DecisionTree"
click node_p5_data "https://github.com/amityadav08/ml_projects_submission/blob/main/Project5_Weather_DecisionTree/data/data_weather.csv"
click node_p5_script "https://github.com/amityadav08/ml_projects_submission/blob/main/Project5_Weather_DecisionTree/weather_classifier.py"
click node_p6 "https://github.com/amityadav08/ml_projects_submission/tree/main/Project6_Handwritten_KNN"
click node_p6_data "https://github.com/amityadav08/ml_projects_submission/tree/main/Project6_Handwritten_KNN/data"
click node_p6_script "https://github.com/amityadav08/ml_projects_submission/blob/main/Project6_Handwritten_KNN/digit_recognition.py"
click node_p7 "https://github.com/amityadav08/ml_projects_submission/tree/main/Project7_Weather_KMeans"
click node_p7_data "https://github.com/amityadav08/ml_projects_submission/blob/main/Project7_Weather_KMeans/data/weather.zip"
click node_p7_script "https://github.com/amityadav08/ml_projects_submission/blob/main/Project7_Weather_KMeans/weather_clustering.py"
click node_p8 "https://github.com/amityadav08/ml_projects_submission/tree/main/Project8_Sentiment_SVM"
click node_p8_data "https://github.com/amityadav08/ml_projects_submission/blob/main/Project8_Sentiment_SVM/data/full_set.txt"
click node_p8_script "https://github.com/amityadav08/ml_projects_submission/blob/main/Project8_Sentiment_SVM/svm_classifier.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_repo_root toneBlue
class node_p2,node_p2_data,node_p2_script,node_p5,node_p5_data,node_p5_script,node_p7,node_p7_data,node_p7_script toneAmber
class node_p3,node_p3_data,node_p3_script toneMint
class node_p4,node_p4_data,node_p4_script,node_p8,node_p8_data,node_p8_script toneRose
class node_p6,node_p6_data,node_p6_script toneIndigo
class node_metrics_summary toneTeal
```

## Components

### Portfolio

Top-level repository overview and shared results index.

- [Portfolio](https://github.com/amityadav08/ml_projects_submission/blob/main/README.md): root · Repository entry point and project index. · `README.md`

### Tabular ML

CSV and numeric-array based supervised and unsupervised pipelines.

- [GDP vs CO2](https://github.com/amityadav08/ml_projects_submission/tree/main/Project2_GDP_CO2_Analysis): project · Exploratory analysis pipeline for GDP and CO2 indicators. · `Project2_GDP_CO2_Analysis`
- [Indicator data](https://github.com/amityadav08/ml_projects_submission/blob/main/Project2_GDP_CO2_Analysis/data/Indicators.bz2): dataset · World Bank-style indicator source file. · `Project2_GDP_CO2_Analysis/data/Indicators.bz2`
- [EDA script](https://github.com/amityadav08/ml_projects_submission/blob/main/Project2_GDP_CO2_Analysis/gdp_analysis.py): analysis script · Performs wrangling, correlation analysis, and plotting. · `Project2_GDP_CO2_Analysis/gdp_analysis.py`
- [Weather tree](https://github.com/amityadav08/ml_projects_submission/tree/main/Project5_Weather_DecisionTree): project · Supervised tabular classification with a decision tree. · `Project5_Weather_DecisionTree`
- [Weather CSV](https://github.com/amityadav08/ml_projects_submission/blob/main/Project5_Weather_DecisionTree/data/data_weather.csv): tabular dataset · Weather measurements and target labels. · `Project5_Weather_DecisionTree/data/data_weather.csv`
- [Tree script](https://github.com/amityadav08/ml_projects_submission/blob/main/Project5_Weather_DecisionTree/weather_classifier.py): classifier script · Selects features and trains a decision tree classifier. · `Project5_Weather_DecisionTree/weather_classifier.py`
- [Weather KMeans](https://github.com/amityadav08/ml_projects_submission/tree/main/Project7_Weather_KMeans): project · Unsupervised clustering pipeline for weather observations. · `Project7_Weather_KMeans`
- [Weather zip](https://github.com/amityadav08/ml_projects_submission/blob/main/Project7_Weather_KMeans/data/weather.zip): dataset · Compressed weather source used for clustering. · `Project7_Weather_KMeans/data/weather.zip`
- [KMeans script](https://github.com/amityadav08/ml_projects_submission/blob/main/Project7_Weather_KMeans/weather_clustering.py): clustering script · Clusters observations and reports quality metrics. · `Project7_Weather_KMeans/weather_clustering.py`

### Geospatial

Indicator data joined with geographic boundaries for map rendering.

- [Geo overlays](https://github.com/amityadav08/ml_projects_submission/tree/main/Project3_GeoOverlays): project · Geographic visualization pipeline for indicator data. · `Project3_GeoOverlays`
- [Geo data](https://github.com/amityadav08/ml_projects_submission/tree/main/Project3_GeoOverlays/data): spatial data · Indicator table and country geometry used for mapping. · `Project3_GeoOverlays/data`
- [Map script](https://github.com/amityadav08/ml_projects_submission/blob/main/Project3_GeoOverlays/geo_visualization.py): visualization script · Builds interactive choropleth maps with Folium. · `Project3_GeoOverlays/geo_visualization.py`

### Text ML

Sentiment classification pipelines over a shared text corpus.

- [Sentiment LR](https://github.com/amityadav08/ml_projects_submission/tree/main/Project4_Sentiment_Logistic): project · Text classification pipeline using logistic regression. · `Project4_Sentiment_Logistic`
- [Text corpus](https://github.com/amityadav08/ml_projects_submission/blob/main/Project4_Sentiment_Logistic/data/full_set.txt): text dataset · Shared sentiment corpus input. · `Project4_Sentiment_Logistic/data/full_set.txt`
- [LR script](https://github.com/amityadav08/ml_projects_submission/blob/main/Project4_Sentiment_Logistic/sentiment_analysis.py): classifier script · Preprocesses text, extracts features, and fits logistic regression. · `Project4_Sentiment_Logistic/sentiment_analysis.py`
- [Sentiment SVM](https://github.com/amityadav08/ml_projects_submission/tree/main/Project8_Sentiment_SVM): project · Text classification pipeline using an SVM. · `Project8_Sentiment_SVM`
- [Text corpus](https://github.com/amityadav08/ml_projects_submission/blob/main/Project8_Sentiment_SVM/data/full_set.txt): text dataset · Shared sentiment corpus input. · `Project8_Sentiment_SVM/data/full_set.txt`
- [SVM script](https://github.com/amityadav08/ml_projects_submission/blob/main/Project8_Sentiment_SVM/svm_classifier.py): classifier script · Preprocesses text, extracts features, and tunes an SVM classifier. · `Project8_Sentiment_SVM/svm_classifier.py`

### Image ML

Digit recognition over NumPy image arrays.

- [Digit KNN](https://github.com/amityadav08/ml_projects_submission/tree/main/Project6_Handwritten_KNN): project · Image classification pipeline using K-nearest neighbors. · `Project6_Handwritten_KNN`
- [Digit arrays](https://github.com/amityadav08/ml_projects_submission/tree/main/Project6_Handwritten_KNN/data): array dataset · Train and test NumPy arrays for handwritten digits. · `Project6_Handwritten_KNN/data`
- [KNN script](https://github.com/amityadav08/ml_projects_submission/blob/main/Project6_Handwritten_KNN/digit_recognition.py): classifier script · Runs distance-based digit recognition over flattened vectors. · `Project6_Handwritten_KNN/digit_recognition.py`

### Reporting

Cross-project result summaries at the repository root.

- [Metrics CSV](https://github.com/amityadav08/ml_projects_submission/blob/main/metrics/metrics_summary.csv): summary index · Cross-project results summary. · `metrics/metrics_summary.csv`

## Connections

- Portfolio → Metrics CSV: indexes · Repository-level summary of experiment results.
- Portfolio → GDP vs CO2: contains · Standalone project folder.
- GDP vs CO2 → Indicator data: reads · Loads indicator data from the local data directory.
- GDP vs CO2 → EDA script: executes · Single analysis entry point.
- EDA script → Metrics CSV: contributes · Outputs results that can be summarized at the root.
- Portfolio → Geo overlays: contains · Standalone project folder.
- Geo overlays → Geo data: reads · Combines indicators with country geometry.
- Geo overlays → Map script: executes · Single visualization entry point.
- Map script → Geo data: joins · Matches tabular indicators to geographic boundaries.
- Portfolio → Sentiment LR: contains · Standalone project folder.
- Sentiment LR → Text corpus: reads · Consumes the sentiment corpus.
- Sentiment LR → LR script: executes · Single NLP training and evaluation entry point.
- LR script → Metrics CSV: reports · Accuracy and error results can be summarized.
- Portfolio → Weather tree: contains · Standalone project folder.
- Weather tree → Weather CSV: reads · Loads tabular weather measurements.
- Weather tree → Tree script: executes · Single supervised learning entry point.
- Tree script → Metrics CSV: reports · Model evaluation results.
- Portfolio → Digit KNN: contains · Standalone project folder.
- Digit KNN → Digit arrays: reads · Loads NumPy arrays for train and test splits.
- Digit KNN → KNN script: executes · Single digit recognition entry point.
- KNN script → Metrics CSV: reports · Classification performance summaries.
- Portfolio → Weather KMeans: contains · Standalone project folder.
- Weather KMeans → Weather zip: reads · Loads the weather archive input.
- Weather KMeans → KMeans script: executes · Single unsupervised learning entry point.
- KMeans script → Metrics CSV: reports · Cluster metrics and diagnostics.
- Portfolio → Sentiment SVM: contains · Standalone project folder.
- Sentiment SVM → Text corpus: reads · Consumes the sentiment corpus.
- Sentiment SVM → SVM script: executes · Single SVM training and evaluation entry point.
- SVM script → Metrics CSV: reports · Accuracy and validation results.
