Overcoming The Limitation In Retail Curbside Pickup Using Machine Learning

Sriram Sampath
Apr 30, 2019 · 8 min read

The recent trend in retail space has been the curbside pickup. Some of the intriguing aspects of the model are its labour-intensive & time-consuming pickup & packaging operations which create a limitation on the number of orders that can be served at a given point of time. Retail stores have become distribution centres for retailers to deliver products to the customer in a faster and efficient way instead of delivering from distribution centres. The volume of orders that can be served increases with the retail store as its nearby to the customer. The last mile is costlier when delivering from distribution centres since the purchase behaviour of the customers has changed. High-frequency & Low volume of orders makes it difficult for the retailers, as most of the retailers experienced an increase in the cost of operation(taking a hit on the margins). Retail stores alleviate the cost factor due to shorter delivery routes than Distribution centres. It entices customers to order more as the delivery time is cut down. Curbside pickup is beneficial for the retailers as it eliminates the need for last mile delivery (one of the hardest problems to solve due to stochasticity in the purchase order). From a customer perspective, it makes sense to pick it up when they commute from work or during other outdoor activity without having to spend time at the store.

Retailers with location advantage could take the large pie of the market share. Walmart already has nearly 4000 stores giving them a better advantage. Other retailers have resorted to a small store format to increase the delivery/pickup points for the customers.

Anatomy Of Operation

Customers can place orders on their app and the employees do the pickup & packaging as they are assigned with orders. This creates an upper limit on the number of orders delivered due to constraints in the availability of the labor. Employees need to navigate the stores to find the product to pick up as this action causes hindrance to existing buyers at the store. When there are more orders to fulfil and there are limited employees then the stores will have to place a constrain on the number of products that can be fulfilled since time matter here. Time to fulfil an order also has to be accounted for in these scenarios. Most of the replenishment is palletized so the work is limited to segregating them into the right sections.

Curbside pick up reduces in-store purchases so the major part of purchasing happens on the online apps. Opening up product discovery — Image search & contextual comparison of similar products in the apps will help customer to arrive at better buy decisions based on their needs. People spend more time watching videos now so their purchase behavior is shaped to a certain extent by what they watch. Having image & contextual searches increases customer activity in the app. Discovery of new products is based on the time spent on the app and how fast they can arrive at the buy decision. Creating newer categories/groups/stores/brands based on similarities gives a new perspective to the consumer.

Demand Mitigation

As the curbside pickup gets crowded, stores will have to mitigate the demand. There has to be ways to demarcate the peak hours and non-peak hours. There should be plans put in place to incentive people to buy during non-peak hours so that there isn’t order spikes at one particular time. The incentive can be an additional discount on the order or on the next purchase if they pick up during non-peak hours.

We can formulate demand mitigation as an energy equation such a way that in order to mitigate demand to a different time slot there will be an energy expenditure. Instead of charging people for convenience during peak hours. A discount can be added to non-peak hours so that customers don’t feel like not buying due to the convenience fee. Most of the grocery pickup has some minimum order threshold and some stores charge customers for the express pace in fulfilling orders.

Minimizing the peak hour demand is the goal of the demand mitigation strategy. Depending on the time of the day & other trends the discount factor has to vary so that the limitation is alleviated. Constrain is placed on the length of the linear combination of events to consider when evaluating the percentage of the discount. Discount is a linear combination of time, seasonal trends, existing demand & economic factors. The minimum amount of energy required to move the demand from a one-time slot to another depending on the volume of demand.

If we frame the problem based on current events alone then the model wouldn’t understand why the demand peaked on certain days/season. People express varying purchase behavior during seasons so the model has to be dynamic and not to be stuck in local minima. There will months where people spend more money or on a buying spree (multiple stops) so a discount estimated based on current demand volume wouldn’t be enough to mitigate the demand. Adding economic variables like debt to income ratio, interest rates, stock market prices, fuel prices, seasonal variables, gives the model a global context on why such events happen (why the demand is peaking today).

x = [Demand at current time slot(usually peak slots), demand at nearby time slots, economic trends & indicators, current order value, Time, Month, Year, Demand during the same period in the past years]

D = Minimum % of discount to move to people away from peak time slots. (Discount to be applied for a nearby time slot).

w = Learnable weights

z = seasonality multiplier

t = Range Limiter

D(W, Y, X) = 1/2 || F(X) — Y || ^2 + z

There is always max threshold order value a slot can be fulfilled in the specified time.

Initially, for collecting the data required for the model, we can take a manual heuristic approach. More weight is given to the order value. Seasonality also drives people to make more purchases.

D = 0.05 * order value + 0.1 * current demand in the time slot + Lambda * seasonality.

Lambda can range from 0 to 3 depending on the seasonality & trend. Seasonality can be divided into [off-season, pre-season, in-season, post-season]. Each seasonality can carry unique weights for example, [0.2, 0.5, 1, 0.5]. In-season always carry more weight. The multiplicative constant can be varied depending scenarios.

Let’s see a scenario where someone orders for $100. The peak time slot is already servicing 18 exciting order and they have a threshold of 25 in an hour. Consider it an off-season.

Discount applied to nearby time slot would be = 0.05 * 100 + 0.1 * 18 + 0.5 * 0.2 = 5 + 1.8 + 0.1= $6.9 dollar discount is assigned to nearby time slot to mitigate demand.

Order value carries more weight and more demand will equate to higher discount additionally seasonality factor will add to the discount. This is manual heuristic to collect the data needed for the model. Generating data for the model is a key aspect to creating a strong machine learning models. Complex manual heuristics can be added to increase dynamic nature of the demand mitigator and also identify what factors influence customers to take certain actions.

We start adding complex heuristics to create better training data for the model. We can add economic trends by normalizing value and taking a mean of all the value multiplied by a weight.

D = 0.05 * order value + 0.1 * current demand at the time slot + 0.05 * economic trends[Normalized & sumed] + Lambda * seasonality

We can always have upper-limit to clip off if its a large value order.

Demand estimation is going to the challenging part of the curbside pickup stores since the order dynamic would be a high-frequency & low volume model. Estimating demand for the product that has irregular purchase behavior would be challenging as there may be a sudden buying spree. Better estimation of inventories enables optimal transportation of inventories thereby reducing the cost of operation significantly. For stores, real-time inventory data will create smooth processing for the customers as they don’t want to find out non-availability of the product after placing the order. The demand forecast is difficult to solve as it relies on the number of factors. How the objective of the demand estimation model is shaped will create better estimation models. Machine Learning models are good at interpolation so constraining the data distribution leads to better accuracy.

Most of the demand estimation models are shaped based on previous sales that has happened with the accommodation of other economic, social media, marketing & seasonal factors. Simple models like holts give a good estimation of the demand and also considers variation due to seasonality. One of the challenging aspects is the event that has a lower occurrence. Data cleansing places a huge role in the accuracy of demand estimation. Sparse/one-off events should they be considered or left out as an outlier will depend on their impact on purchase behavior. Each product has different customer lifecycle (some products are bought more often while some periodic recurrence)so the data can become imbalanced. There may not be enough data variation to account for such events so the model accuracy is compromised.

Pricing impacts purchase behavior of the consumer. The number of commute people makes to a retail store depends on pricing, unique assortment, availability of the product at all time, quality of the product, value for the money, comfort, social story & ease of shopping.

Reshaping the objective of demand estimation

There is always an upper limit (capital availability = income + credit cards -monthly recurring expenses )on how a consumer would spend in a month. Price of products has to be dynamic to mimic the varying purchase behavior. Taking account of the daily prices of products (Gasoline, health expenses, food expenses, grocery, recurring monthly bought products, stock market prices, bond prices, commodity prices, pay-per-view buys/entertainment, rent, season, insurance, taxes& EMI) that are mostly used by people will give a good estimate of how the purchase behavior of people is going to be depending on pricing. The future price of the products has to be accounted for since a lot of variables impact such as tariff, petrol prices, commodity prices, climate, logistics pricing etc. Price prediction is not a one-sided aspect. Events happening in the economy creates stored up energy (When the stock market prices are going up, it directly affects the purchase behavior as the confidence among the consumer is high and while rise interest rate can cause two types of behavior among the customer. One being restraining action where the people save money up in anticipation of the future increase in their cost of living and other action being expending today to buy the product that may be costlier tomorrow).

Better Way To Buy Groceries & Retail Products

Retail operation is predominantly about transportation if we reduce the transportation cost there will more leeway for the stores to offer better prices due to increased margins. Stores can expand on the creative discount side. Demand forecast determines how & when the retail products are transported.

The demand forecast is directly tied up to the purchase behavior of the consumer. A stochastic environment creates more uncertainty in the demand estimation thereby increasing the number of the transportation process.

Most of the retail orders are repetitive and even known prior hand that these products require a refill. Subscription models give certainty to the stores about the volume of orders, so now the stores can better plan and transport products in an optimal way that doesn’t increase the cost of operation. The increased margins can be used to provide additional benefits to the customer. If the demand is known then all the supply chain operation remains deterministic leading to the optimal allocation of transportation vehicle, product quantity, resource allotment, reduced number of transportation, and better margins to sustain & improve existing systems.

Sriram Sampath

Written by

I am an Data Scientist And an Entrepreneur. Currently working on Work Degrees to alleviate the demand for skilled labor.

The Startup

Medium's largest active publication, followed by +562K people. Follow to join our community.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade