Sep 23–26, 2019

From Whiteboard to Production: a Demand Forecasting System for an Online Grocery Shop

Robert Pesch (inovex GmbH), Robin Senge (inovex GmbH)
4:35pm5:15pm Wednesday, September 25, 2019
Location: 1A 08/10
Secondary topics:  Retail and e-commerce, Temporal data and time-series analytics

Who is this presentation for?

Everyone involved in the development of data-driven (ML) products, i.e. Data Scientists, Data Engineers, Product Owners, DevOps Engineers, and many other roles.




Data-driven software products employ statistical and machine learning models inferred from data to drive business goals. By this, they are revolutionizing the world and enable intelligent services we interact daily.

The development of such products requires many short iterations, and the close collaboration of software developers, data engineers, data scientist, and DevOps engineers to translate an idea from whiteboard to a fully-fledged software system integrated into a complex enterprise IT environment.

In this talk, we outline the development process, the statistical modeling, the data-driven decision making and the components needed for productionizing a fully automated demand forecasting system for an online grocery shop for a billion-dollar retail group in Europe.

On the whiteboard: For e-grocery stores, accurate stock planning is the key ingredient for the success of the whole business case. Compared to non-grocery stores, supply chain optimization is an even harder task due to perishable items in combination with a broad variety of goods sold according to a long tail distribution. In order for an e-grocery business to sustain many challenges along its supply chain have to be approached. Accurate stock planning resides in the very center of all efforts: unavailability of items results in unsatisfied customers and potential loss of customers, whereas maximum stock filling results in food spoilage which again results in higher cost for the retailer.

Balancing these two factors is not trivial. Just predicting a single value (a point prediction) for the demand for each article for a certain time in the future (for example 100 grape units for next week) is often not sufficient, as this prediction ignores the stochastic part and the random fluctuations of the demand. Thus, predicting the entire probability distribution is often required to obtain the cost-optimal forecast. Many different models and approaches exist for obtaining such a prediction: ranging from simple models to complex models.

Traditional forecasting models such as exponential smoothing, ARIMA, and the newly developed Facebook Prophet library can be applied to get point predictions for arbitrary forecasting horizons. Modeling the problem as a regression problem extends the prediction capability and allows the integration of features and to choose from different models like linear regression models, support vector machines, or regression trees. Combining such predictions with parametric probability distributions provides a good starting point for the desired probability function. More tailored models like GAMLSS allow the direct prediction of probability distributions.

Towards the production system: Building a demand forecasting system for an e-grocery business is a complex and complicated task. Hence we approached the task in an agile fashion. We started with a very simple almost naive solution. This provided us a with two important things: (i) a fast first version of our data product that was able to serve as a proof of concept for further development, and (ii) a simple baseline model to compare to when experimenting with more complex predictive models.

Up until now, long after the going live of the MVP, the system is developed further in agile iterations and constantly improved. Hence, every new predictive model version that is likely to be more complex than its predecessor has to prove that its increased complexity also significantly increases accuracy. In alignment with Occam’s Razor and also with machine learning theory, this way we seek to not overcomplicating things. Complex models like deep neural nets have the potential to learn extraordinary complex relations. However, this ability comes with a high risk of overfitting, instability, and outliers. Building a productive, fully automated demand forecasting system for approximately one billion predictions per day, you better take care of these risks.

Going into more technical detail, the talk will cover and sketch a variety of software features that distinguish a prototypical notebook model from a full-fledged highly scalable production system. These include extracting the original customer request, outlier and fraud detection mechanisms for the input data, sanity checks for the output data, a fallback solution, a risk-sensitive model selection, and model monitoring.

Prerequisite knowledge

Some basic understanding of ML models and forecasting.

What you'll learn

Start simple: already simple models add value; fail fast; the machine learning part of a data-product is only one component of many; predicting a single value (point prediction) is not always sufficient.
Photo of Robert Pesch

Robert Pesch

inovex GmbH

Robert Pesch is a senior data scientist and big-data engineer at Inovex GmbH. Robert holds a PhD in Bioinformatics and a MSc in Computer Science. He gets most excited about analyzing large and complex data sets and implementing novel insight-generating data-products utilizing advanced mathematical and statistical models.

Photo of Robin Senge

Robin Senge

inovex GmbH

Robin Senge received his M.Sc. degree in computer science from the University of Marburg, Germany, in 2006. After graduation, he worked as a software engineer in industry, where he was consigned to consulting and developed software for financial applications like trading and portfolio management systems. In 2009, he joined the Computational Intelligence Lab at the University of Marburg as a doctoral student. His research topics were focused on machine learning and fuzzy systems. After successfully finishing his PhD in 2015 he joined inovex GmbH to work as a Senior Data Scientist. Being a data enthusiast he is currently part of an analytics team applying machine learning to optimize supply chain processes of one of the biggest group of retailers in Germany.

Leave a Comment or Question

Help us make this conference the best it can be for you. Have questions you'd like this speaker to address? Suggestions for issues that deserve extra attention? Feedback that you'd like to share with the speaker and other attendees?

Join the conversation here (requires login)

Contact us

For conference registration information and customer service

For more information on community discounts and trade opportunities with O’Reilly conferences

For information on exhibiting or sponsoring a conference

Contact list

View a complete list of Strata Data Conference contacts