Skip to content

Repository files navigation

Bakery Operations Analytics

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.

Product case study at a glance

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

Why This Project Exists

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.

Dataset

Demand is measured as item records sold. It should not be interpreted as customer count, revenue, or profit.

Analysis Workflow

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

Methods and Formulas

ABC classification

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

EOQ, safety stock, and reorder point

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.

Moving-average forecasting

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.

Key Findings From Current Outputs

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.

Recommendation and decision status

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.

Charts and Outputs

Generated CSV outputs are stored in outputs/. Generated chart images are stored in outputs/charts/.

Selected generated visuals

ABC Pareto chart for bakery item demand

Forecast comparison for actual demand, 3-day moving average, and 7-day moving average

Reorder point for A-class bakery items

Useful chart files include:

  • outputs/charts/abc_pareto_chart.png
  • outputs/charts/eoq_by_item.png
  • outputs/charts/reorder_point_by_item.png
  • outputs/charts/safety_stock_by_item.png
  • outputs/charts/daily_forecast_3_day_ma.png
  • outputs/charts/daily_forecast_7_day_ma.png
  • outputs/charts/forecast_comparison.png
  • outputs/charts/top_10_items.png
  • outputs/charts/hourly_demand_pattern.png
  • outputs/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.

Evidence / Report

Run the Analysis

Install dependencies:

pip install -r requirements.txt

Run the full analysis pipeline from the repository root:

python analysis/run_all.py

Generate report, presentation, viva, context, and quality-check assets:

python analysis/07_report_assets.py

Project Structure

analysis/          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

Team Contribution Areas

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

Replace the Dataset

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.py

analysis/01_prepare_data.py contains fallback sample-data generation for testing when no raw file exists. For actual analysis, use a real dataset.

Limitations

  • 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.

Future Improvements

  • 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.

About

Product case study: turning bakery demand data into a cautious, measurable inventory decision.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages