Logistics and supply chainBI, AI and ML for the business
Demand and stock forecasting
Sales history and stock levels are already in the ERP. Your data scientist builds a forecasting model with scikit-learn; Muvia runs it every night next to the data and puts forecast, actual sales and understock in front of the people who reorder.
Illustrative scenario: it describes a typical case, not a customer project.
The forecast often exists already. It lives on someone's laptop.
In many companies an analyst has already built a model that forecasts demand by item. It runs by hand, on an ERP export, when there is time; the numbers end up in a file that purchasing may or may not open.
Muvia does not sell a ready-made forecast: the model stays your team's, with your features and your choices. Muvia runs it on a schedule against governed data and brings the result to where reorders are decided.
- Who it's for
- Data scientists and analysts who build the model; purchasing, supply chain and warehouse teams who use its forecasts.
In Muvia, step by step
Real product screens, recorded on a project with sample data.
The video · Sales history and stock levels are already in the ERP. Your data scientist builds a forecasting model with scikit-learn; Muvia runs it every night next to the data and puts forecast, actual sales and understock in front of the people who reorder.
What you get
- The model stays yours
- The team decides the algorithm, the features and when to retrain. Muvia does not replace the data scientist: it gives the model a place where it actually runs.
- Forecast next to actual
- The dashboard shows where and when the model misses, so you know when it is time to revisit it.
- Understock seen earlier
- The alarm starts from forecast cover, not from an empty shelf, and stays in the alarm register with whoever handles it.
- A run you can check
- Every night the same function version runs on the same governed data; a new model is a new version, tried before it goes live.
For the technical team
How it is built in Muvia
- 1
Bring sales and stock into Muvia
The ERP and the warehouse database become sources copied every night, incrementally and over an encrypted connection. Promotions and sell-out arrive as files; every source becomes a table you can query.
- 2
Prepare features in SQL
In the SQL editor, compute weekly sales by item and warehouse, moving averages, the same week last year and active promotions. The result is a dataset with stable fields: the contract between the data and the model.
- 3
Build the model
The data scientist trains a scikit-learn model in their own environment, on data pulled through the read-only API, and attaches it as a joblib file to a Python function. Alternatively, the function can refit a scikit-learn estimator on every run, on the window of history it receives.
- 4
Run forecasts every night
A scheduled flow hands the features to the function and writes forecasts into a managed table. Try it first in trial mode, which writes nothing; then recompute history to see how it would have forecast past weeks.
- 5
Compare and alert
A dashboard puts forecast and actual sales on the same chart, by item and warehouse. An alarm opens when forecast cover falls below the threshold, and the reorder report goes out every Monday.
Python function
import joblib
FEATURES = ["sold_last_week", "moving_avg_4", "same_week_last_year",
"promo_active", "week_of_year"]
def transform(inputs, params, ctx):
model = joblib.load(ctx.file("demand.joblib"))
df = inputs["rows"]
out = df[["item", "warehouse", "week", "on_hand"]].copy()
out["forecast_qty"] = model.predict(df[FEATURES]).clip(min=0)
forecast = out["forecast_qty"].where(out["forecast_qty"] > 0)
out["weeks_of_cover"] = out["on_hand"] / forecast
out["understock"] = out["weeks_of_cover"] < params["min_weeks_of_cover"]
ctx.logger.info("forecasts computed: %d rows", len(out))
return {"rows": out}- The data it needs
- Orders and sales lines by item and customer, from the ERP on SQL Server
- Stock on hand and safety stock by warehouse, from the warehouse's Oracle database
- Promotions plan, from an Excel file uploaded each month
- Weekly distributor sell-out, CSV files received over SFTP
More cases in this line
All use cases- Stock coverage and low-stock alarmsSales and stock by item already live in the ERP and the warehouse system. Muvia works out every day how many days of cover each item has left, opens an alarm when it drops below the threshold and closes it by itself once goods arrive, with who handled it in the register.
- Supplier punctuality and OTIFReceipt lines already tell you who delivers on time and in full, provided the data is clean. In Muvia, rules on the data set aside the impossible rows, OTIF is worked out delivery by delivery, and the supplier ranking shows who is slipping and since when.
- Delivery times and carrier punctualityEvery shipment leaves a dispatch time and a delivery time, scattered between the warehouse and the carriers' files. Muvia brings them together: where time is lost between warehouse and customer, which carrier slows down in which area and from which week, and the carrier review already written.
Guides on these numbersDemand forecasting: methods, forecast error and a calculatorDays of inventory coverage: the reorder point and safety stock
Dashboards from this caseDemand forecast and its error, from sales history on PostgreSQL
Bring us a question you can't answer today.
We start from a real question your business has and walk the path from source to dashboard with your systems, not a demo dataset.