The system concludes with a functional Streamlit Dashboard that bridges the gap between raw data science and business decision-making.
Real-time KPIs: Displays average daily demand and dataset health.
Interactive History: Adjustable look-back periods (7 to 180 days) to analyze seasonal trends.
Automated Forecasting: Utilizes the saved XGBoost model to generate a 7-day rolling demand forecast.
- Ensure you have run the Ml.ipynb notebook to generate daily_demand.csv and demand_model.pkl.
- Run the following command in your terminal:
streamlit run app.py
I used MLflow to manage the model lifecycle. This ensured that every hyperparameter tweak was logged and measurable.
Experiment Name: Retail_Demand_Forecasting
Logged Metrics: Mean Absolute Error (MAE), Root Mean Squared Error (RMSE).
Artifacts: Automated versioning of the XGBoost model for deployment.
- Ingestion: Cleaning 1,067,371 rows of UCI Online Retail II transactional data.
- Transformation: Aggregating hourly transactions into daily demand totals.
- Feature Engineering: Creating lag variables (
$t-1, t-7$ ) and holiday flags. - Modeling: Training an XGBoost Regressor with time-series cross-validation.
- Inference: Serving predictions via the Streamlit web interface.