# aniket-singh10/mess-food-feedback-analyzer architecture

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

- Interactive diagram: https://gitdiagram.com/aniket-singh10/mess-food-feedback-analyzer
- Repository: https://github.com/aniket-singh10/mess-food-feedback-analyzer

## Overview

1. **Repository purpose**
   - This is a small machine-learning project for **predicting mess food ratings** from a few survey-style inputs.
   - The core architecture is an **offline ML workflow**: prepare data, train a regression model, persist the model, then run analysis/prediction with the saved artifact.

2. **Primary subsystems**
   - **Data layer:** `data/mess_data.csv`
   - **Model training layer:** `model/train_model.py`
   - **Saved model artifact:** `model/model.pkl`
   - **Analysis / prediction layer:** `analysis.py`
   - **Optional application entrypoint:** `app.py`
   - **Documentation/report:** `README.md`, `Project_Report.pdf`

3. **Data source and schema**
   - The CSV dataset is the main input to the system.
   - The README says the features are:
     - Food Quality
     - Cleanliness
     - Quantity
     - Taste
   - The target being modeled is the **mess rating**.

4. **Training flow**
   - `model/train_model.py` is the training pipeline.
   - It reads `data/mess_data.csv`, selects the input features, trains a **Linear Regression** model, and saves the trained estimator to `model/model.pkl`.
   - This creates a clear boundary between **training-time computation** and **runtime inference**.

5. **Inference / analysis flow**
   - `analysis.py` is the analysis and prediction script.
   - It likely loads the trained model artifact from `model/model.pkl`, applies it to user-provided or sample inputs, and produces predicted ratings.
   - The README also mentions a **graph visualization of feedback**, so this script likely includes plotting as part of the analysis output.

6. **Modeling approach**
   - The model is explicitly **Linear Regression**, which implies a simple supervised regression architecture rather than a deep learning or classification pipeline.
   - The system is designed for **continuous rating prediction**, not categorical decisions.

7. **Artifact boundary**
   - The important persisted artifact is `model/model.pkl`.
   - That file is the handoff point between training and downstream usage, meaning the model can be reused without retraining every time.
   - This separation is useful when drawing the architecture: dataset → training script → serialized model → analysis/prediction.

8. **Runtime and tooling**
   - The repo depends on **pandas**, **scikit-learn**, and **matplotlib**.
   - pandas supports CSV loading and tabular data handling.
   - scikit-learn provides the regression model and likely evaluation utilities.
   - matplotlib supports the feedback/rating visualization.

9. **Operational mode**
   - This is not an always-on service; it is a **script-driven workflow**.
   - The README indicates separate commands for training and analysis, so the project behaves more like a local analytics pipeline than a deployed web backend.

10. **`app.py` role**
   - `app.py` exists as a separate entrypoint, but the README does not describe it.
   - For an architecture diagram, it should be treated as a possible user-facing or orchestration layer, while the documented core system remains the training/analysis pipeline.

11. **External dependencies**
   - There are no visible external APIs, databases, or cloud services in the repo structure.
   - The system appears self-contained around the local CSV file and serialized model artifact.

12. **Suggested diagram boundaries**
   - **Input boundary:** CSV dataset and any runtime user inputs.
   - **Processing boundary:** training script and analysis script.
   - **Output boundary:** predicted ratings and plotted visualizations.
   - **Persistent boundary:** saved model file used to bridge training and inference.

13. **Overall architecture in one sentence**
   - The repository implements a lightweight, local ML workflow where survey data is trained with linear regression, stored as a pickle model, and reused for rating prediction and visualization.

Main entry points: [`model/train_model.py`](https://github.com/aniket-singh10/mess-food-feedback-analyzer/blob/main/model/train_model.py) (Train script), [`analysis.py`](https://github.com/aniket-singh10/mess-food-feedback-analyzer/blob/main/analysis.py) (Analysis script), [`README.md`](https://github.com/aniket-singh10/mess-food-feedback-analyzer/blob/main/README.md) (README), [`app.py`](https://github.com/aniket-singh10/mess-food-feedback-analyzer/blob/main/app.py) (App entrypoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_g1["Data & Inputs"]
  node_n1["Mess data<br/>csv dataset<br/>[mess_data.csv]"]
  node_n2["User inputs<br/>runtime features"]
end

subgraph group_g2["Training Pipeline"]
  node_n3["Train script<br/>training pipeline<br/>[train_model.py]"]
  node_n4["Feature prep<br/>tabular prep"]
  node_n5(("Linear regression<br/>scikit-learn model"))
  node_n6[("Model artifact<br/>pickle model<br/>[model.pkl]")]
end

subgraph group_g3["Inference & Analysis"]
  node_n7["Analysis script<br/>prediction analysis<br/>[analysis.py]"]
  node_n8["Prediction flow<br/>inference logic"]
  node_n9(("Plots<br/>visualization"))
  node_n10["App entrypoint<br/>optional runner<br/>[app.py]"]
end

subgraph group_g4["Docs"]
  node_n11["README<br/>documentation<br/>[README.md]"]
  node_n12["Report<br/>[Project_Report.pdf]"]
end

node_n1 -->|"training data"| node_n3
node_n3 -->|"prepare"| node_n4
node_n4 -->|"fit"| node_n5
node_n5 -->|"save"| node_n6
node_n6 -->|"load"| node_n7
node_n2 -->|"inputs"| node_n8
node_n7 -->|"run"| node_n8
node_n8 -->|"visualize"| node_n9
node_n10 -.->|"orchestrate"| node_n7
node_n10 -.->|"train"| node_n3
node_n11 -.->|"describes"| node_n3
node_n11 -.->|"describes"| node_n7
node_n12 -.->|"supports"| node_n11

click node_n1 "https://github.com/aniket-singh10/mess-food-feedback-analyzer/blob/main/data/mess_data.csv"
click node_n3 "https://github.com/aniket-singh10/mess-food-feedback-analyzer/blob/main/model/train_model.py"
click node_n6 "https://github.com/aniket-singh10/mess-food-feedback-analyzer/blob/main/model/model.pkl"
click node_n7 "https://github.com/aniket-singh10/mess-food-feedback-analyzer/blob/main/analysis.py"
click node_n10 "https://github.com/aniket-singh10/mess-food-feedback-analyzer/blob/main/app.py"
click node_n11 "https://github.com/aniket-singh10/mess-food-feedback-analyzer/blob/main/README.md"
click node_n12 "https://github.com/aniket-singh10/mess-food-feedback-analyzer/blob/main/Project_Report.pdf"

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_n1,node_n2 toneBlue
class node_n3,node_n4,node_n5,node_n6 toneAmber
class node_n7,node_n8,node_n9,node_n10 toneMint
class node_n11,node_n12 toneRose
```

## Components

### Data & Inputs

Local dataset and runtime inputs used by the ML workflow.

- [Mess data](https://github.com/aniket-singh10/mess-food-feedback-analyzer/blob/main/data/mess_data.csv): csv dataset · Survey-style training data with food quality, cleanliness, quantity, taste, and mess rating. · `data/mess_data.csv`
- **User inputs**: runtime features · Survey or sample feature values supplied for prediction at runtime.

### Training Pipeline

Offline model-building flow that learns and persists the regressor.

- [Train script](https://github.com/aniket-singh10/mess-food-feedback-analyzer/blob/main/model/train_model.py): training pipeline · Reads the dataset, selects features, fits the regression model, and saves the artifact. · `model/train_model.py`
- **Feature prep**: tabular prep · Loads and organizes the input columns used for supervised learning.
- **Linear regression**: scikit-learn model · Supervised regressor used to predict continuous mess ratings.
- [Model artifact](https://github.com/aniket-singh10/mess-food-feedback-analyzer/blob/main/model/model.pkl): pickle model · Serialized trained estimator reused by downstream prediction and analysis. · `model/model.pkl`

### Inference & Analysis

Scripts that load the saved model and produce predictions or plots.

- [Analysis script](https://github.com/aniket-singh10/mess-food-feedback-analyzer/blob/main/analysis.py): prediction analysis · Loads the saved model, runs predictions, and produces analysis output. · `analysis.py`
- **Prediction flow**: inference logic · Applies the trained model to input features and generates rating estimates.
- **Plots**: visualization · Graphical feedback or rating visualization produced during analysis.
- [App entrypoint](https://github.com/aniket-singh10/mess-food-feedback-analyzer/blob/main/app.py): optional runner · Separate entry script that may orchestrate or expose the workflow. · `app.py`

### Docs

Repository documentation and report files.

- [README](https://github.com/aniket-singh10/mess-food-feedback-analyzer/blob/main/README.md): documentation · Project overview and usage notes for training and analysis. · `README.md`
- [Report](https://github.com/aniket-singh10/mess-food-feedback-analyzer/blob/main/Project_Report.pdf): project report · Supplementary PDF report describing the project. · `Project_Report.pdf`

## Connections

- Mess data → Train script: training data · The CSV dataset is consumed by the training pipeline.
- Train script → Feature prep: prepare · Training script selects and organizes the rating features.
- Feature prep → Linear regression: fit · Prepared features are used to train the regression model.
- Linear regression → Model artifact: save · The fitted estimator is serialized to the pickle artifact.
- Model artifact → Analysis script: load · Analysis script reuses the persisted model for downstream work.
- User inputs → Prediction flow: inputs · Runtime feature values are passed into the prediction flow.
- Analysis script → Prediction flow: run · Analysis script drives inference using the loaded model.
- Prediction flow → Plots: visualize · Predictions or feedback are rendered as plots.
- App entrypoint → Analysis script: orchestrate · Optional entrypoint may launch the analysis workflow.
- App entrypoint → Train script: train · Optional entrypoint may also trigger training.
- README → Train script: describes · README documents the training workflow.
- README → Analysis script: describes · README documents analysis and prediction usage.
- Report → README: supports · Project report complements the repository documentation.
