Late-order early warning
Measure the wait. Explain the delay. Predict the risk. Warn early.
The method of my MSc thesis, run end to end on synthetic order data. Every chart below reads one export from tested Python code.
Measure: where does the time go?
Five stages from order date to full delivery. The solid bar is the median. The light bar runs on to P90, the slowest one in ten.
Synthetic data
- Order handling and engineering164669%Median 16 days, P90 46 days, Share of spread 69%
- Planning361%Median 3 days, P90 6 days, Share of spread 1%
- Production queue112619%Median 11 days, P90 26 days, Share of spread 19%
- Production13229%Median 13 days, P90 22 days, Share of spread 9%
- Post-production6111%Median 6 days, P90 11 days, Share of spread 1%
The customer’s wait, by configuration
Median wait from order to delivery, against the median promised interval.
- Standard61% on timeWait 47Promised 51
- Modified47% on timeWait 61Promised 59
- Engineered24% on timeWait 83Promised 63
Explain: which stages cause the delay?
Excess late days are the days a stage ran past its usual length, on lines that arrived late. Sorted from most to least, as a Pareto chart: a few causes usually carry most of the effect.
Synthetic data
2 stages carry 80% of the excess late days.
- Order handling and engineering54%Running total 54%
- Production queue26%Running total 80%
- Production11%Running total 91%
- Post-production6%Running total 97%
- Planning3%Running total 100%
Reliability: is the promise kept?
The first promised date against the day the line was fully delivered.
Synthetic data
Days early or late against the first promise
The promise against the customer’s wait
- Standard tableClearance to ex-factory46
- Promised intervalOrder date to first promise56
- Customer waitOrder date to delivery, median and P90Median 55P90 93
49% of lines waited longer than promised.
Every date change is a warning sign
| Date changes | Lines | Late | Median days late |
|---|---|---|---|
| 0 | 2,700 | −10 | |
| 1 | 1,828 | +6 | |
| 2 | 765 | +18 | |
| 3 | 798 | +36 |
Predict: enter an order
The decision tree sees only what is known on the day the order is entered. Change the order and watch it walk the tree.
Synthetic data
The two clocks start on different days. The table starts at clearance, after order handling. The customer counts from the order date.
The path through the tree
- Question 1: Factory load at or below 1.04?No50% → 68%
- Question 2: Ordered outside the peak months, March to June?No68% → 75%
- Question 3: Configuration is Standard?No75% → 85%
- Question 4: Configuration is Modified?Yes85% → 82%
- Leaf 27: 596 training lines, 82% of them late.
What drives the prediction
Forest, late risk
- Factory load32%
- Peak season18%
- Configuration16%
- Order month13%
- Standard days5%
- Quantity4%
- Lines on the order4%
- Item group4%
- Product family3%
Forest, delivery days
- Configuration40%
- Factory load22%
- Peak season13%
- Standard days6%
- Order month6%
- Lines on the order4%
- Quantity4%
- Item group3%
- Product family3%
Tree, late risk
- Factory load62%
- Configuration22%
- Peak season10%
- Standard days6%
- Order month0%
- Product family0%
- Item group0%
- Quantity0%
- Lines on the order0%
Tree, forest and today’s promise
Tested on 2023 to 2024 orders the models never saw: 1,818 lines.
| Measure | Decision tree | Random forest | Standard-table promise |
|---|---|---|---|
| Precision: share of alerts that were really late | 0.69 | 0.73 | 0.00 |
| Recall: share of late lines that got an alert | 0.69 | 0.69 | 0.00 |
| ROC area: 0.5 is a coin toss, 1.0 is perfect | 0.78 | 0.80 | 0.50 |
| Mean error, delivery days | 13.5 | 13.2 | 16.2 |
The promise rule never predicts a late line, so beating it on late risk is a low bar. Tree against forest is the useful comparison.
Warn: replay 2024
The agent wakes each morning, sees only what was on file that day, and flags lines likely to be late. Press play to replay the year.
Synthetic data
40 of 40 sample alerts so far
Template-generated. In the study, an LLM phrases these messages from the same scores.
No alerts yet. Press play.
- 30 Dec 2024MCS-24-0341/4Late risk at entry 9%
Order MCS-24-0341 line 4 may slip. Engineering has held it 1.5x longer than usual. Late risk at entry was 9%.
What happened: On time, 7 days early
- 17 Dec 2024MCS-24-0306/1Late risk at entry 9%
Order MCS-24-0306 may slip. Production has held it 1.5x longer than usual. Late risk at entry was 9%.
What happened: On time, 15 days early
- 4 Dec 2024MCS-24-0316/2Late risk at entry 17%
Order MCS-24-0316 line 2 may slip. Engineering has held it 1.5x longer than usual. Late risk at entry was 17%.
What happened: On time, on the promised day
- 14 Nov 2024MCS-24-0301/3Late risk at entry 9%
Order MCS-24-0301 line 3 may slip. Engineering has held it 1.5x longer than usual. Late risk at entry was 9%.
What happened: On time, 1 day early
- 15 Oct 2024MCS-24-0291/3Late risk at entry 17%
Order MCS-24-0291 line 3 may slip. Planning has held it 1.7x longer than usual. Late risk at entry was 17%.
What happened: On time, 25 days early
- 14 Oct 2024MCS-24-0294/2Late risk at entry 81%
Order MCS-24-0294 line 2 is likely late. No stage is overdue yet. Late risk at entry is 81% because configuration is Engineered and factory load is above 0.81.
What happened: Arrived 42 days late
- 20 Sep 2024MCS-24-0255/2Late risk at entry 23%
Order MCS-24-0255 line 2 is already 2 days past its first promised date. Post-production has held it 1.5x longer than usual. Late risk at entry was 23%.
What happened: Arrived 8 days late
- 4 Sep 2024MCS-24-0264/1Late risk at entry 23%
Order MCS-24-0264 may slip. Engineering has held it 1.5x longer than usual. Late risk at entry was 23%.
What happened: Arrived 10 days late
- 20 Aug 2024MCS-24-0254/3Late risk at entry 38%
Order MCS-24-0254 line 3 may slip. Planning has held it 1.7x longer than usual. Late risk at entry was 38%.
What happened: On time, 13 days early
- 4 Aug 2024MCS-24-0235/1Late risk at entry 23%
Order MCS-24-0235 may slip. Planning has held it 1.7x longer than usual. Late risk at entry was 23%.
What happened: Arrived 1 day late
- 16 Jul 2024MCS-24-0234/3Late risk at entry 69%
Order MCS-24-0234 line 3 is likely late. No stage is overdue yet. Late risk at entry is 69% because configuration is Engineered and factory load is above 0.81.
What happened: Arrived 34 days late
- 24 Jun 2024MCS-24-0213/1Late risk at entry 56%
Order MCS-24-0213 is likely late. No stage is overdue yet. Late risk at entry is 56% because factory load is above 1.04 and entered in a peak month.
What happened: On time, 9 days early
- 18 Jun 2024MCS-24-0205/1Late risk at entry 82%
Order MCS-24-0205 is likely late. No stage is overdue yet. Late risk at entry is 82% because factory load is above 1.04 and configuration is not Standard.
What happened: Arrived 49 days late
- 9 Jun 2024MCS-24-0193/2Late risk at entry 82%
Order MCS-24-0193 line 2 is likely late. No stage is overdue yet. Late risk at entry is 82% because factory load is above 1.04 and configuration is not Standard.
What happened: Arrived 34 days late
- 3 Jun 2024MCS-24-0183/1Late risk at entry 80%
Order MCS-24-0183 is likely late. No stage is overdue yet. Late risk at entry is 80% because factory load is above 1.04 and standard-table time is 37 days or less.
What happened: On time, 1 day early
- 28 May 2024MCS-24-0174/3Late risk at entry 56%
Order MCS-24-0174 line 3 is likely late. No stage is overdue yet. Late risk at entry is 56% because factory load is above 1.04 and entered in a peak month.
What happened: On time, 6 days early
- 18 May 2024MCS-24-0165/4Late risk at entry 82%
Order MCS-24-0165 line 4 is likely late. No stage is overdue yet. Late risk at entry is 82% because factory load is above 1.04 and configuration is not Standard.
What happened: Arrived 8 days late
- 14 May 2024MCS-24-0158/1Late risk at entry 80%
Order MCS-24-0158 is likely late. No stage is overdue yet. Late risk at entry is 80% because factory load is above 1.04 and standard-table time is 37 days or less.
What happened: Arrived 7 days late
- 5 May 2024MCS-24-0149/2Late risk at entry 56%
Order MCS-24-0149 line 2 is likely late. No stage is overdue yet. Late risk at entry is 56% because factory load is above 1.04 and entered in a peak month.
What happened: Arrived 4 days late
- 23 Apr 2024MCS-24-0136/2Late risk at entry 56%
Order MCS-24-0136 line 2 is likely late. No stage is overdue yet. Late risk at entry is 56% because factory load is above 1.04 and entered in a peak month.
What happened: On time, 1 day early
- 15 Apr 2024MCS-24-0029/1Late risk at entry 41%
Order MCS-24-0029 is already 6 days past its first promised date. Post-production has held it 1.5x longer than usual. Late risk at entry was 41%.
What happened: Arrived 8 days late
- 14 Apr 2024MCS-24-0125/1Late risk at entry 56%
Order MCS-24-0125 is likely late. No stage is overdue yet. Late risk at entry is 56% because factory load is above 1.04 and entered in a peak month.
What happened: On time, 2 days early
- 8 Apr 2024MCS-24-0116/1Late risk at entry 82%
Order MCS-24-0116 is likely late. No stage is overdue yet. Late risk at entry is 82% because factory load is above 1.04 and configuration is not Standard.
What happened: Arrived 44 days late
- 6 Apr 2024MCS-24-0110/1Late risk at entry 80%
Order MCS-24-0110 is likely late. No stage is overdue yet. Late risk at entry is 80% because factory load is above 1.04 and standard-table time is 37 days or less.
What happened: Arrived 20 days late
- 31 Mar 2024MCS-24-0052/3Late risk at entry 41%
Order MCS-24-0052 line 3 may slip. Post-production has held it 1.5x longer than usual. Late risk at entry was 41%.
What happened: On time, 12 days early
- 23 Mar 2024MCS-24-0097/1Late risk at entry 80%
Order MCS-24-0097 is likely late. No stage is overdue yet. Late risk at entry is 80% because factory load is above 1.04 and standard-table time is 37 days or less.
What happened: On time, 2 days early
- 22 Mar 2024MCS-24-0050/3Late risk at entry 41%
Order MCS-24-0050 line 3 may slip. The production queue has held it 1.7x longer than usual. Late risk at entry was 41%.
What happened: Arrived 26 days late
- 13 Mar 2024MCS-24-0064/3Late risk at entry 41%
Order MCS-24-0064 line 3 may slip. Planning has held it 1.7x longer than usual. Late risk at entry was 41%.
What happened: Arrived 9 days late
- 12 Mar 2024MCS-24-0089/1Late risk at entry 80%
Order MCS-24-0089 is likely late. No stage is overdue yet. Late risk at entry is 80% because factory load is above 1.04 and standard-table time is 37 days or less.
What happened: On time, 3 days early
- 8 Mar 2024MCS-24-0079/2Late risk at entry 82%
Order MCS-24-0079 line 2 is likely late. No stage is overdue yet. Late risk at entry is 82% because factory load is above 1.04 and configuration is not Standard.
What happened: Arrived 55 days late
- 8 Mar 2024MCS-24-0034/1Late risk at entry 41%
Order MCS-24-0034 may slip. Engineering has held it 1.5x longer than usual. Late risk at entry was 41%.
What happened: Arrived 44 days late
- 3 Mar 2024MCS-24-0071/2Late risk at entry 80%
Order MCS-24-0071 line 2 is likely late. No stage is overdue yet. Late risk at entry is 80% because factory load is above 1.04 and standard-table time is 37 days or less.
What happened: Arrived 20 days late
- 28 Feb 2024MCS-24-0012/2Late risk at entry 23%
Order MCS-24-0012 line 2 may slip. Post-production has held it 1.5x longer than usual. Late risk at entry was 23%.
What happened: Arrived 3 days late
- 15 Feb 2024MCS-24-0023/2Late risk at entry 41%
Order MCS-24-0023 line 2 may slip. Planning has held it 1.7x longer than usual. Late risk at entry was 41%.
What happened: On time, 11 days early
- 13 Feb 2024MCS-24-0045/2Late risk at entry 69%
Order MCS-24-0045 line 2 is likely late. No stage is overdue yet. Late risk at entry is 69% because configuration is Engineered and factory load is above 1.04.
What happened: Arrived 29 days late
- 6 Feb 2024MCS-24-0004/2Late risk at entry 17%
Order MCS-24-0004 line 2 may slip. Production has held it 1.5x longer than usual. Late risk at entry was 17%.
What happened: On time, 7 days early
- 27 Jan 2024MCS-23-0304/1Late risk at entry 9%
Order MCS-23-0304 is already 2 days past its first promised date. Post-production has held it 1.5x longer than usual. Late risk at entry was 9%.
What happened: Arrived 9 days late
- 12 Jan 2024MCS-23-0311/1Late risk at entry 9%
Order MCS-23-0311 may slip. Post-production has held it 1.5x longer than usual. Late risk at entry was 9%.
What happened: On time, 12 days early
- 1 Jan 2024MCS-23-0290/3Late risk at entry 81%
Order MCS-23-0290 line 3 is already 8 days past its first promised date. Engineering has held it 1.7x longer than usual. Late risk at entry is 81% because configuration is Engineered and factory load is above 0.81.
What happened: Arrived 48 days late
- 1 Jan 2024MCS-23-0191/1Late risk at entry 94%
Order MCS-23-0191 is already 129 days past its first promised date. No stage is overdue yet. Late risk at entry is 94% because factory load is above 1.04 and configuration is not Standard.
What happened: Arrived 137 days late
What-if: two levers
A Monte Carlo simulation reruns every synthetic line many times with random draws, with one change. Pick a lever and a level.
Synthetic data
Checked first: the simulated baseline gives 51.4% on time against 50.7% in the synthetic data, and a median of 55 days against 55.
Monte Carlo with common random numbers: every scenario reuses the same random draws, so a difference comes from the change alone. 5 runs of every line per scenario. Direction and rough size only, not cost.
How this demo is built
- Seeded generatorAbout 6,000 synthetic order lines with planted patterns. The same seed gives the same numbers.
- Python and scikit-learnStage analysis, a depth-4 tree and a random forest, an agent replay and a simulation. Covered by pytest.
- One export, walked hereThe page reads one JSON export. Your browser walks the same tree the Python code trained.
Honest limits: the models find the patterns because the generator planted them. This shows the method works end to end. It does not show what the real data will say.