An Operations Management project that uses public bakery transaction data to analyze product demand, classify inventory priorities, calculate replenishment parameters, and compare short-term moving-average forecasts.
The project is framed around two main OM tools:
- Inventory analysis: ABC classification, EOQ, safety stock, and reorder point.
- Forecasting: 3-day and 7-day moving average demand forecasts.
Capacity planning files are present in the repository, but they are treated as supporting appendix analysis rather than a third main tool.
| Dimension | Evidence |
|---|---|
| User decision | Which products deserve the closest review, and what evidence is still missing before changing replenishment policy? |
| Data boundary | Demand patterns are measured from 21,293 public transaction rows; cost, lead-time, service-level, and staffing inputs are synthetic |
| My contribution | EOQ, safety-stock, and reorder-point analysis within a five-person coursework team |
| Product decision | Use ABC analysis to prioritize where validation effort should go; do not treat scenario outputs as production purchasing rules |
| Critical learning | The 7-day baseline beats the 3-day baseline, but 102.97% MAPE is too high for operational forecasting |
| Next validation | Replace synthetic assumptions with supplier data and compare a seasonal or weekday-aware forecast against a naive baseline |
A bakery with uneven item demand needs a practical way to decide which products require the most attention, when to reorder priority items, and how much near-term demand to expect. This project turns transaction-level data into inventory and forecasting outputs that could support weekly production and replenishment planning.
The transaction data is real/public. Cost, lead-time, service-level, holding-rate, and staffing assumptions are synthetic academic assumptions because those internal operating variables are not included in the public dataset.
- Source: Kaggle Dataset: Transactions from a Bakery
- Link: https://www.kaggle.com/datasets/sulmansarwar/transactions-from-a-bakery
- Raw file:
data/bakery_sales_raw.csv - Cleaned file:
data/bakery_sales_cleaned.csv - Raw rows: 21,293
- Cleaned item records: 20,507
- Unique transactions: 9,465
- Unique items: 94
- Date range: 2016-10-30 to 2017-04-09
Demand is measured as item records sold. It should not be interpreted as customer count, revenue, or profit.
Raw transaction CSV
-> clean and standardize date/time/item fields
-> summarize demand by item, date, hour, weekday, and period of day
-> classify items using ABC analysis
-> calculate EOQ, safety stock, and reorder points for A-class items
-> compare 3-day and 7-day moving-average demand forecasts
-> export CSV tables, charts, report assets, and recommendation files
analysis/03_abc_analysis.py ranks items by demand count and calculates cumulative demand percentage.
- A-class: cumulative demand percentage <= 80%
- B-class: cumulative demand percentage <= 95%
- C-class: remaining items
analysis/04_eoq_rop_analysis.py applies these calculations to A-class items:
Average daily demand = demand_count / active_days
Annual demand = average_daily_demand * 365
Holding cost per unit = unit_cost * annual_holding_rate
EOQ = sqrt((2 * annual_demand * ordering_cost) / holding_cost_per_unit)
Safety stock = z_score * daily_demand_std * sqrt(lead_time_days)
Reorder point = average_daily_demand * lead_time_days + safety_stock
The file data/synthetic_operational_assumptions.csv is generated from stated assumptions and observed demand variation. These assumptions should be replaced with real supplier and inventory data before using the model operationally.
analysis/06_forecasting.py compares:
- 3-day moving average
- 7-day moving average
Forecast accuracy is summarized with MAE and MAPE in outputs/forecast_accuracy_summary.csv.
| Area | Finding |
|---|---|
| Top five items | Coffee, Bread, Tea, Cake, Pastry |
| Top five demand share | 59.06% of item demand |
| Busiest date | 2017-02-04 with 292 item records |
| Busiest hour | 11:00 with 3,102 item records across the dataset |
| Busiest weekday | Saturday with 4,605 item records |
| A-class items | 13 items, representing 13.83% of unique items and 78.61% of demand |
| Highest EOQ | Coffee, 2,034.88 units |
| Highest reorder point | Bread, 65.06 units |
| Better forecast in this run | 7-day moving average |
The 7-day moving average produced lower error in the generated results:
| Method | MAE | MAPE | Evaluated Days |
|---|---|---|---|
| 3-day moving average | 40.85 | 109.53% | 156 |
| 7-day moving average | 31.73 | 102.97% | 152 |
The MAPE values are high, so the forecast should be treated as a transparent planning baseline rather than a precise demand predictor.
Use the ABC result to prioritize validation work on A-class items, especially Coffee, Bread, Tea, Cake, and Pastry. Do not deploy the current EOQ, safety-stock, reorder-point, or forecast values as purchasing rules yet:
- The replenishment values depend on synthetic cost, lead-time, service-level, and holding assumptions.
- The 7-day moving average performs better than the 3-day version, but its 102.97% MAPE is too high for reliable operational planning.
- The next useful decision is to collect real supplier and inventory inputs, then test the proposed policy in a limited pilot against the current process.
The current analysis is decision-support evidence and a validation plan, not a production inventory policy.
Generated CSV outputs are stored in outputs/. Generated chart images are stored in outputs/charts/.
Useful chart files include:
outputs/charts/abc_pareto_chart.pngoutputs/charts/eoq_by_item.pngoutputs/charts/reorder_point_by_item.pngoutputs/charts/safety_stock_by_item.pngoutputs/charts/daily_forecast_3_day_ma.pngoutputs/charts/daily_forecast_7_day_ma.pngoutputs/charts/forecast_comparison.pngoutputs/charts/top_10_items.pngoutputs/charts/hourly_demand_pattern.pngoutputs/charts/weekend_vs_weekday_demand.png
Report support files are stored in report_assets/, including final_results_summary.md, report_tables.md, viva_defense_notes.md, and presentation/report outlines.
- Operations report PDF - final written submission artifact.
- Presentation deck - slide deck artifact for the project presentation.
Install dependencies:
pip install -r requirements.txtRun the full analysis pipeline from the repository root:
python analysis/run_all.pyGenerate report, presentation, viva, context, and quality-check assets:
python analysis/07_report_assets.pyanalysis/ Python scripts for cleaning, demand analysis, ABC, EOQ/ROP, forecasting, and recommendations
data/ Raw dataset, cleaned dataset, and generated synthetic operational assumptions
outputs/ CSV outputs and final quality checks
outputs/charts/ Generated PNG charts
report_assets/ Tables, summaries, outlines, viva notes, and checklist files
| Name | Registration Number | Contribution Area |
|---|---|---|
| Bushra Khan | 2022139 | Demand data and pattern summary |
| Mariam | 2022208 | ABC classification |
| Muhammad Arsal | 2022350 | EOQ, safety stock, and reorder point |
| Rukh e Zahra | 2022508 | Supporting capacity appendix |
| Zainab Bilal | 2022635 | Forecasting and final recommendations |
To reuse the pipeline with another bakery transaction dataset, replace data/bakery_sales_raw.csv with a CSV containing similar fields. The preparation script supports common variants of Date, Time, Transaction, and Item column names.
Then rerun:
python analysis/run_all.py
python analysis/07_report_assets.pyanalysis/01_prepare_data.py contains fallback sample-data generation for testing when no raw file exists. For actual analysis, use a real dataset.
- The public dataset does not include supplier cost, holding cost, lead time, inventory balance, waste, staffing, or preparation-time records.
- EOQ, safety stock, reorder point, and capacity calculations depend on synthetic assumptions.
- Demand is counted as item records, not revenue, profit, or customer visits.
- Moving averages do not model holidays, promotions, weather, closures, or special events.
- Duplicate raw rows were detected but not removed because repeated item lines may represent multiple units in the same transaction.
- Capacity planning is supporting appendix analysis only and should not be presented as a main OM tool.
- Replace synthetic cost and lead-time assumptions with real supplier and inventory data.
- Add revenue or margin data if available.
- Compare moving averages with seasonal or weekday-aware forecasting methods.
- Add automated checks that validate generated outputs after each pipeline run.
- Convert the generated outputs into an interactive dashboard for easier review.


