Skip to content

Forecasting product demand using Random Forests with Recursive Feature Elimination

Notifications You must be signed in to change notification settings

sheilateozy/product-demand-forecaster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Forecasting Nestlé's product demand

Using Random Forests with Recursive Feature Elimination

I interned as a Data Scientist at Nestlé USA.

This is the project that I worked on, which increased demand prediction accuracy by 9.4% from existing models, translating into cost savings of $3.4 million.

  • SQL to query and manipulate big data on SAS.
  • Designed, implemented, and back-tested optimal models using custom scoring metrics.
  • Feature selection using Recursive Feature Elimination.
  • Data visualisation dashboarding on Microsoft Power BI to depict business impact of new models.

    About

    My work involved improving Nestlé's existing demand forecasting models through 3 aspects, as follows:

    1. Feature selection tool: Recursive Feature Elimination

    Nestlé collects an enormous amount of data, such as demand data, promotional data, holiday data, and competitor data. With this large amount of features available to be used for modelling, the team required a robust feature selection tool.

    The first aspect of my project involved designing an end-to-end framework for feature selection (code and documentation). The goal was to (i) Increase model accuracy through technical feature selection methods instead of human intuition and domain expertise, and (ii) Increase model explainability to non-technical stakeholders within Nestlé.

    I designed an approach that utilized Recursive Feature Elimination (RFE) through Permutation Feature Importance with Random Forests. This new approach improves on the current feature selection approach used by the team through the following aspects:

    2. Feature selection at different levels

    Next, I explored different levels in which to conduct feature selection. Feature selection can be conducted at 3 main levels:

  • Business level: The term “business” at Nestlé refers to a category of products that Nestlé sells, examples being the Baking business, the Beverage business, and so on. Under this method, one would conduct feature selection for an entire business of products, and use this same selected features to forecast demand for all products under that business.
  • Product level: Within any one business, there are hundreds of products. For example, two different products within Nestlé’s Baking business are pies and cakes. Conducting feature selection at the product level instead would mean selecting features to use for forecasting demand for each unique product, and using different features in modelling between different products within the same business.
  • Product and store level: Nestlé sells its products at thousands of stores around the world. Different products are sold at each store. Conducting feature selection at the product and store level entails using different features for each product-store pair.

    Among the 3 levels, I determine the optimal level at which feature selection should be conducted by back-testing across various time periods to find the level that results in the highest forecasting accuracy.

    3. Benchmark suite of machine learning models:
    Elastic Net, Random Forest, XGBoost, Deep Neural Network

    The team had primarily been using traditional Statistics-based models such as ARIMA, ARIMAX, and other regression-based models for time-series demand forecasting. However, they were keen to branch out and adopt other machine learning-based models. Hence, I also worked on benchmarking models that had not yet been used by the team prior, using a custom scoring metric termed Demand Planning Accurcacy at Nestlé.

    Results: Making an impact at Nestlé

    My work increased the accuracy of product demand forecasts by 9.4% on average across 6 categories of Nestlé products, with the exact breakdown as follows:

    This translates into cost savings of $3.4 million across the various categories:

    Project Methodology

    1. Feature engineering: Transform time-series problem into supervised learning problem
    2. Encode categorical variables using Hash Encoding
    3. Tune Random Forest using Random Search
    4. Obtain unbiased permutation feature importances
    5. Feature selection using Recursive Feature Elimination (RFE)
    6. Train model on optimal subset of features
    7. Repeat for various levels of forecasting to determine optimal level
    8. Repeat for different models to determine optimal model

    Still curious?

    Check out this project on my website here :)

  • About

    Forecasting product demand using Random Forests with Recursive Feature Elimination

    Topics

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published