Distribution & supply chainDecision intelligenceScenario simulation

Factory reallocation & shipping optimisation engine

A machine-learning decision platform that predicts shipping lead times from historical order data, simulates the effect of reassigning production between factories, and ranks the resulting options by combined time saving and margin impact.

10,194
historical orders used to train the model
15
products across the modelled catalogue
5
factories and 4 shipping regions simulated
4
decision workspaces in the delivered interface

The problem

Orders were assigned to factories largely by habit and geography. Nobody could answer, with evidence, whether shipping a particular product from a different site would be faster, cheaper, or both — and there was no way to test the idea short of trying it on real customers.

Thousands of completed orders already contained that answer. They just sat in exports nobody could analyse.

What we built

1 · Lead time prediction

We trained a Random Forest regressor on the full order history — product, factory, destination region, quantity and seasonality — to predict shipping lead time for any combination. It was evaluated against Linear Regression and Gradient Boosting baselines and selected on held-out performance.

2 · Scenario simulation engine

A what-if layer that takes a proposed reassignment — move a share of one factory's volume to another — and projects the resulting blended lead time, blended margin and capacity utilisation before anything changes in the real world.

3 · Recommendation engine

Rather than leaving the user to explore combinations manually, the platform evaluates every viable factory pairing and ranks them by a priority score combining lead time saved with margin percentage, so the highest-impact moves surface first. Options that would breach a factory's safe capacity ceiling are penalised automatically.

4 · The interface

Delivered as a four-tab decision workspace:

  • Overview — current state across factories, products and regions
  • Factory Simulator — move volume between sites and watch the projections update
  • What-If Analysis — compare multiple scenarios side by side
  • Recommendations — the ranked list, with the reasoning behind each score

Built with Python, scikit-learn, Streamlit and Plotly, with a dark and light presentation mode, deployed to a hosted environment with the source in the client's own repository.

The result

Factory allocation moved from an opinion to a modelled decision. Instead of debating whether a reassignment would help, the team could see the predicted lead time change, the margin effect and the capacity consequence in the same view — and had a ranked shortlist of the moves most worth making.

Try the mechanics yourself

The operations simulator on our live demo dashboard reproduces the same interaction model against sample data. Move volume between factories and watch the blended lead time, margin and utilisation respond.

What we'd extend next

  • Direct ERP integration so scenarios run against live order data rather than periodic exports
  • Cost-to-serve modelling layered on top of lead time and margin
  • Automatic re-training as new orders complete
Interface stills

The delivered system

Screens from the delivered system, deliberately obscured. We publish structure and density, never a client's data or naming — the same protection your project would get.

Overview workspace
Overview workspace
Factory simulator
Factory simulator
What-if analysis
What-if analysis
Ranked recommendations
Ranked recommendations

See the simulator running

The same interaction model, live on this site, against sample distribution data.