Demand Forecasting Solution
Solution Background and Business Value
Demand forecasting is essential for industries such as sales, retail, manufacturing, and supply chain management. Accurate demand predictions help businesses optimize storage, transportation, and inventory planning, reducing waste and improving operational efficiency. For example, a meal kit delivery service benefits from demand forecasting by ensuring they order the correct amount of raw ingredients to match recipe demand, preventing shortages and minimizing waste.
Forecasting accuracy is typically measured using MAE
(Mean Absolute Error) or SMAPE
(Symmetric Mean Absolute Percentage Error). Depending on business needs, forecasts can be made for different time frames and aggregation levels, such as:
-
Forecasting the number of orders per recipe group six weeks ahead.
-
Predicting the total demand for specific ingredients over the next 28 days.
Data Requirements and Schema
Core Tables
-
Sales/Orders Table: Captures historical sales transactions.
-
order_id
(Primary Key) -
item_id
(Foreign Key referencing Items) -
buyer_id
(Foreign Key referencing Buyers) -
group_id
(Foreign Key referencing Groups) -
event_id
(Foreign Key referencing Events) -
timestamp
(Date and time of the sale) -
quantity
(Number of items sold)
-
-
Items Table: Stores static information about each item.
item_id
(Primary Key)
-
Groups Table: Categorizes items for aggregated forecasting.
group_id
(Primary Key)
-
Buyers Table: Contains buyer information to enhance predictive accuracy.
buyer_id
(Primary Key)
-
Events Table: Records external factors that may affect demand, such as holidays or promotions.
-
event_id
(Primary Key) -
timestamp
(Date and time of the event)
-
Entity Relationship Diagram (ERD)
Predictive Queries
Kumo allows flexible demand forecasting using Predictive Queries. Below are five different ways to forecast demand:
-
Forecasting demand using order count:
-
Forecasting demand using sum of item quantities:
-
Forecasting at an aggregated category level:
-
Predicting demand six weeks into the future:
-
Filtering out instances where demand is zero:
Deployment Strategy
Demand forecasting models are typically deployed in automated pipelines that refresh predictions on a set cadence (daily, weekly, or monthly). The workflow includes:
-
Data Preparation: The latest sales and entity data snapshots are refreshed in the data warehouse.
-
Model Inference: Kumo ingests the data and generates future demand predictions, which are stored in the desired output location.
-
Data Transformation: If necessary, post-processing is applied, such as ensuring non-negative predictions:
-
Consumption: Predictions are either reviewed by analysts for strategic decision-making or directly integrated into downstream applications for inventory planning, marketing, and logistics.
Building models in Kumo SDK
1. Initialize the Kumo SDK
2. Connect Data
3. Select tables
4. Create graph schema
5. Train the model