Inventory Management
🛍️

Inventory Management

Retail inventory management is the backbone of any retail business, essentially enabling you to keep your business in order. It’s the system and processes you implement to keep a record of your stores' inventory. Whilst we can probably all agree that some type of inventory management process is crucial. Having the right automated inventory management system in place can make all the difference. Out of stock items equals frustrated customers and loss of sales which over time could damage a retailer’s reputation and lose future customers and sales.

Problem Statement

Using historical sales data, the latest order made by the retailer, and supplier's delivery info create the list of orders that should be submitted next.

Dataset

Few datasets needed as input, with the following attributes and sample previews:
 
Sales Data
Variable
Datatype
Description
datetime
day of the year
int
shop identifier
int
product identifier
int
product category identifier
float
product price
int
total quantity sold
notion image
 
Items
Variable
Datatype
Description
int
unique product identifier
int
product category identifier
int
how long the shipment takes to reach your inventory
int
the maximum lead time that may be required in case of supplier delays
int
number of items available in stock at the beginning
int
the time taken for the supplier to accept and process the order
notion image
 
Orders
Variable
Datatype
Description
int
product identifier
int
shop identifier
int
total ordered number of items
datetime
day when order was purchased
datetime
day when order expected to be received
notion image
 
Order Items
Variable
Datatype
Description
int
product identifier
int
shop identifier
notion image
 
Supplier Restrictions
Variable
Datatype
Description
int
product identifier
int
minimum number of products that can be ordered
notion image

Datrics Pipeline

We have build 3 separated pipelines to solve this problem.
Build Demand Forecasting Model
The first one called "1.Train" are all about get historical data, filter data related only to the shop we are interested in (e.g. shop_id = 31), mark categorical variables using Typization Brick, and feed all that data into LGBM Regression with the following configuration:
notion image
As a result, we get model that would be used to predict future sales for each product.
notion image

Predict Demand

The next pipeline called "2.Predict", uses the model trained in the previous pipeline, and preprocessed data to forecast the product's sales.
Here we filter products only related to one shop (e.g shop_id = 31), generate time frame for prediction using Date Range Brick,
and using Join Brick with the "cross join" options we get all possible combinations of product and day from the prediction period.
notion image
Other required data for the pre-trained model usage (e.g item price) are taken from the input historical data. As the last step in this section, we get a prediction for each product for the next month starting from '2015-01-14'. The result is saved as an asset (to be easily reused in the final pipeline).

Calculate Reorder Point

The next and last one pipeline called "3.GetOrders" relates to calculations we need to perform to get inventory management figures.
A reorder point (ROP) is the minimum unit quantity that a business should have in available inventory before they need to reorder more products. Reorder points ensure that you don’t fall behind on your next batch of inventory. With an accurate reorder point for each SKU, you’ll always have enough stock on hand to satisfy customer demand — without tying up excess capital in inventory.
Reorder point formula
Reorder Point (ROP) = Max lead time x Max daily sales
Lead time is the total amount of time for a purchase order to be delivered from a supplier. So, if the supplier only accepts reorders once a week and you place an order 4 days before the day the order will be accepted by the supplier, your inventory will need to last an additional four days. This additional 4 day is known as the reordering delay. The lead time is the sum of the supply delay, which is how long the shipment takes to reach your inventory, plus the reordering delay.
Lead time = supply delay + reordering delay
Back to platform capabilities, Max Lead Time is given as an input for each product in the Items dataset, while maximum daily sales are calculated using Data Aggregate Bricks from the historical sales dataset. Using this data as an input and Apply Formula Brick, we can easily calculate ROP for each product.
Finally, we load the last orders made by the retailer, and using Join Data Brick combines that data with predicted products daily demand.
After that, we fill missing values and sum predicted product daily items to be sold using Rolling Function Custom Brick for each product to get rolling demand.
After joining data from the previous steps using Join Data Brick, we can add to the starting stock - items arrived on that day and subtract already calculated rolling demand, to get inventory level for each day in the predicted days period.
To get a day for each item when the new order should be purchased we compare the daily level of inventory with Reorder Point using Compare Data Brick. For the day when ROP is smaller or equals inventory level, the amount of product that should be purchased from the supplier on that day is given within the supplier restrictions input dataset (e.g. minimum batch size for an item that can be ordered).
As a result, we get the list of orders with dates specified when these orders should be submitted to the supplier:
notion image
Â