Customer Stories

Automation of AI Demand Forecasts for 5000 Products Across 6 Price Ranges with MLOps for a Large Retailer

AI & Machine Learning
AI Forecasting & Demand Planning
MLOps & Feature Store
The post thumbnail

Our Client

Our client is one of the largest retailers in the Polish market, renowned for offering a wide range of electronic products.

The company owns a substantial number of physical stores, as well as online brands differentiated by their offerings and price levels. The issue they sought to address was the need for more accurate planning of future sales, leading to purchase plans and resulting stock levels that were not always aligned with demand. Orders were previously based on demand reported by product managers, which often lacked consistency and were prone to mistakes. Determined to introduce more order and stability, as well as streamline this process, the client decided to employ advanced machine learning solutions to create reliable sales forecasts


The main goal of the project was to implement a reliable sales forecasting platform with a user-friendly business interface for demand planners, aiming to achieve better precision and automation.

The key objectives were as follows:

  • Increase product availability by reducing instances of “out of stock” situations.
  • Improve turnover of goods by reducing overstocks.
  • Automate and streamline the entire planning process.
  • Establish a state-of-the-art analytical platform for data science applications.
  • Develop a business application for demand planners to effectively utilize analytical forecasts.

The forecasting solution was expected to provide the organization with the following:

  • Long-term (26 weeks) predictions in a highly volatile and competitive market.
  • Reliable sales forecasts incorporating various key sales determinants with unknown future values such as prices, deliveries, and new product launches.
  • All of this running on an easy-to-use MLOps platform consisting of the Feature Store, Model Repository, Model Factory, Machine Learning, and Feature Transformation microservices.
Electronic Retailer


The project consisted of three main parts:

  • MLOps platform: This involved designing and setting up an analytical environment based on microservices and open-source software, in compliance with corporate policies and standards.
  • Sales forecasting machine learning models: The project included the implementation of self-tuning predictive models for sales across various product segments.
  • Dedicated application for demand planning: The development of a user-friendly interface for product managers and demand planners, equipped with the ability to manage, recalculate, and override the forecasts.

The MLOps platform was specifically designed to fulfill all of the client’s requirements, providing a comprehensive solution that supports training, scoring, versioning, and monitoring processes throughout the entire model lifecycle.

Within this MLOps framework, we trained and deployed a system of machine learning models that generated the final sales forecasts.

The final component of the implementation was the planning application, which enabled business users to analyze forecasts and initiate appropriate business actions


An MLOps platform is a set of integrated technological solutions that facilitate the efficient deployment and maintenance of machine learning models. By incorporating various tools and processes, it ensures that technical and analytical users adhere to good DevOps practices while working with ML. The MLOps platform automates model deployment, reducing repetitive tasks for Data Scientists and simplifying development and deployment workflows.

Illustration of the MLOps open source demand planning solution

Following the business analysis phase, we closely collaborated with the client’s data engineers to integrate all necessary data from various sources into the staging database. This raw input was then used to prepare data tables in the feature store, which contained the business features required for building the forecasting models. Once the features were implemented based on the data model designed during the analysis phase, our team of data scientists could commence work on the models.

The sales forecasting models were implemented within a short timeframe, thanks to Algomine’s extensive experience in similar projects and excellent cooperation with the client’s experts. Prior to development, we conducted a month-long analysis phase to gain a thorough understanding of the business requirements and formulate a clear and specific plan to meet the expectations.

The list of products was divided into several forecasting segments based on the product hierarchy and revenue. Four models were trained for four typical segments in the client’s business model. For most applications, we utilized variations of the Gradient Boosting algorithm to generate the results. Training, scoring, and monitoring were implemented as microservices that could be run in multiple instances, with data exchange handled using queues. We used MLflow as the model repository and set up a feature store using the Feast library.

At this phase of the project, we generate forecasts for over 5,000 products across approximately 6 price ranges each, resulting in predictions for about 30,000 time series over a 26-week horizon. These forecasts are based on data such as historical sales, stock levels, pricing and promotions, shelf availability, and calendar events. The use of segmentation methods and predecessor dictionaries enables the system to begin forecasting new products even before their launch.

This solution is highly scalable, as it ultimately generates forecasts for approximately 9,000,000 product sales models, which equates to over 50 million time series.

The demand planning application, designed specifically for business users, enables them to work effortlessly with forecast results generated by advanced machine learning models. They can analyze different scenarios and make purchasing decisions based on precise sales forecasts. If needed, users can independently apply expert adjustments, providing them with even greater flexibility in their actions.

Demand Planning Application panel


The solution enables the client to forecast sales and make effective purchasing decisions, resulting in a significant reduction in out-of-stock and overstock periods. The solution automates processes related to sales and operations planning (S&OP), purchasing, and the operationalization of business activities. As a result, the planning department’s efficiency has greatly increased, allowing them to tackle new business challenges.

The main objectives of the project were fully achieved:

  • A comprehensive MLOps platform that can be utilized for any ML application, extending beyond sales forecasting.
  • A unified and consistent process for sales forecasting that can be fully automated.
  • Long-term, detailed forecasts with price-range breakdowns.
  • A user-friendly interface for controlling model parameterization, reviewing, and adjusting forecasts.

Through parallelization, the entire training process was shortened to approximately 3 hours, achieving a mean absolute percentage error of only a few percent for a group of popular products.

The delivered pipeline is a comprehensive solution that automates the entire sales forecasting process while providing business users with control over the governing parameters.