How rama-alsadeq/ecommerce-delay-prediction-mlops works
This is an e-commerce delivery-delay ML project: it develops a primary late/on-time classifier and a separate delay-days regression task, with the classifier exposed through a FastAPI service. The production request path validates order features, applies saved feature rules and scaling, predicts with a registered model, and records monitoring data. The README describes broader data preparation, analysis, training, validation, and model-management capabilities; their detailed implementation is not shown in the sampled source, so those branches use documented relationships only.
Main entry points: main.py Prediction API · monitoring.py Metrics and Drift · notebooks Feature Engineering and Modeling · production Production Feature Artifacts
Components 19
Data and Modeling
- Olist Tables
- Join Tables
notebooks/1-Read&join-tables.ipynb - Create Labels
notebooks/2-Create-the-lables.ipynb - Dataset Split
notebooks/3-Train-validation-test-split.ipynb - Explore Data
notebooks/4-EDA.ipynb - Feature Engineering and Modeling
notebooks
Data Quality
- Feature Expectations
gx/define_expectations.py
Prediction Serving
- Prediction API
app/main.py - Request Validation
src/validation.py - Feature Preparation
src/features.py - Feature Scaling
src/preprocessing.py - Model Inference
src/predictor.py - Feature Schema
src/data.py
Model Operations
- Production Feature Artifacts
artifacts/production - MLflow Model Registry
Monitoring
- Metrics and Drift
src/monitoring.py - Prediction Log
config/config.yaml - Reference Distribution
artifacts/monitoring/reference_prediction_distribution.json
Other components
- API Client
Connections 21
- API Client → Prediction API: submits requests
app/main.py - Prediction API → MLflow Model Registry: loads registered model
app/main.py - Prediction API → Request Validation: validates features
app/main.py - Request Validation → Feature Schema: checks feature schema
src/validation.py - Prediction API → Feature Preparation: prepares features
app/main.py - Feature Preparation → Production Feature Artifacts: loads feature rules
src/features.py - Prediction API → Feature Scaling: scales features
app/main.py - Feature Scaling → Production Feature Artifacts: loads scaler
src/preprocessing.py - Prediction API → Model Inference: runs inference
app/main.py - Prediction API → Metrics and Drift: records requests and predictions
app/main.py - Prediction API → Metrics and Drift: serves metrics
app/main.py - Metrics and Drift → Prediction Log: appends predictions
src/monitoring.py - Metrics and Drift → Reference Distribution: compares distribution
- Olist Tables → Join Tables: reads and aggregates
README.md - Join Tables → Create Labels: creates order-level data
README.md - Create Labels → Dataset Split: splits labeled data
README.md - Dataset Split → Explore Data: explores training data
README.md - Explore Data → Feature Engineering and Modeling: guides feature and model work
README.md - Feature Engineering and Modeling → Production Feature Artifacts: saves preprocessing objects
README.md - Feature Engineering and Modeling → MLflow Model Registry: tracks and registers models
README.md - Feature Expectations → Feature Schema: checks final features
gx/define_expectations.py