How gokulkrisnaa-n/food-delivery-prediction works
This repository serves food-delivery-time predictions through a FastAPI endpoint backed by a serialized XGBoost pipeline. The request workflow is order submission, API validation, pipeline inference, and a versioned prediction response; a separate offline workflow cleans training data, engineers features, trains and evaluates the regressor, and saves the pipeline. Optuna tuning informs model parameters. The training, tuning, and artifact-generation links are evidenced by excerpts; deployment details are documented, but deployment infrastructure is not mapped as runtime code.
Main entry points: delivery_time_xgb.py Training workflow · main.py FastAPI service · delivery_time_pipeline_0.1.0.joblib Serialized pipeline · tune_xgb.py Optuna tuning
Components 13
Prediction service
- FastAPI service
app/main.py - Request validation
app/main.py - Prediction handler
app/main.py - Serialized pipeline
app/model/delivery_time_pipeline_0.1.0.joblib
Model development
- Training workflow
app/model/delivery_time_xgb.py - Feature engineering
app/model/delivery_time_xgb.py - XGBoost regressor
app/model/delivery_time_xgb.py - Optuna tuning
app/hyperparameter-tuning/tune_xgb.py
Model data
- Tuned parameters
app/hyperparameter-tuning/best_params.json - Training data
app/model/train.csv - Test data
app/model/test.csv - Test predictions
app/model/submission.csv
Other components
- Order client
Connections 13
- Order client → FastAPI service: submits order
README.md - FastAPI service → Request validation: validates request
app/main.py - FastAPI service → Prediction handler: routes prediction
app/main.py - Prediction handler → Serialized pipeline: loads and predicts
app/main.py - Serialized pipeline → Prediction handler: returns estimate
app/main.py - Training workflow → Training data: reads
app/model/delivery_time_xgb.py - Training workflow → Test data: reads
app/model/delivery_time_xgb.py - Training workflow → Feature engineering: fits and transforms
app/model/delivery_time_xgb.py - Training workflow → XGBoost regressor: trains and evaluates
app/model/delivery_time_xgb.py - Training workflow → Serialized pipeline: serializes
app/model/delivery_time_xgb.py - Training workflow → Test predictions: writes predictions
app/model/delivery_time_xgb.py - Optuna tuning → Feature engineering: uses preprocessing
app/hyperparameter-tuning/tune_xgb.py - Optuna tuning → Tuned parameters: writes parameters
app/hyperparameter-tuning/tune_xgb.py