Demand Forecasting Solution
Solution Background and Business Value
Demand forecasting predicts future item demand so businesses can optimize inventory, reduce waste, and improve operational efficiency across sales, retail, manufacturing, and supply chain.
For example, a meal kit delivery service uses demand forecasting to order the correct amount of raw ingredients per recipe, 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 target different time frames and aggregation levels:
-
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 expresses demand forecasting logic as Predictive Queries: SQL-like statements that define what to predict and over what time window.
The syntax PREDICT <aggregation>(table.column, start_offset, end_offset, time_unit) FOR EACH table.id_column specifies the aggregation function, the prediction window as offsets from the anchor time, and the entity to predict for.
-
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).
-
Data Preparation: Refresh the latest sales and entity data snapshots in the data warehouse.
-
Model Inference: Kumo ingests the data and generates future demand predictions, storing results in the configured output location.
-
Data Transformation: Apply post-processing as needed. For example, clamp negative predictions to zero:
-
Consumption: Analysts review predictions for strategic decision-making or feed them directly into downstream applications for inventory planning, marketing, and logistics.
Building models in Kumo Fine-Tune SDK
1. Initialize the Kumo Fine-Tune SDK
2. Connect Data
3. Select tables
4. Create graph schema
5. Train the model