How aniket-singh10/mess-food-feedback-analyzer works
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: train_model.py Train script · analysis.py Analysis script · README.md README · app.py App entrypoint
Components 12
Data & Inputs
Local dataset and runtime inputs used by the ML workflow.
- Mess data · Survey-style training data with food quality, cleanliness, quantity, taste, and mess rating.
data/mess_data.csv - User inputs · Survey or sample feature values supplied for prediction at runtime.
Training Pipeline
Offline model-building flow that learns and persists the regressor.
- Train script · Reads the dataset, selects features, fits the regression model, and saves the artifact.
model/train_model.py - Feature prep · Loads and organizes the input columns used for supervised learning.
- Linear regression · Supervised regressor used to predict continuous mess ratings.
- Model artifact · 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 · Loads the saved model, runs predictions, and produces analysis output.
analysis.py - Prediction flow · Applies the trained model to input features and generates rating estimates.
- Plots · Graphical feedback or rating visualization produced during analysis.
- App entrypoint · Separate entry script that may orchestrate or expose the workflow.
app.py
Connections 13
- 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.