This project implements a hierarchical regression model for promotion optimization, developed during the AB InBev Global Analytics Hackathon. The solution focuses on optimizing promotional spend allocation across a multi-level product hierarchy (brand, price segment, pack type, size, and SKU) while respecting business constraints. Our team placed 7th globally out of 150+ teams in the competition.
The model uses a hierarchical parameter structure where each parameter consists of two components:
- A global parameter
$w$ that represents the shared behavior across all SKUs - A hierarchical parameter
$w^h$ that captures SKU-specific deviations from the global
This structure is implemented through the BaseModuleClass, which manages both global and hierarchical parameters. The ActivatedParameter class wraps PyTorch parameters with configurable activation functions (tanh, sigmoid, or relu).
We enforce the hierarchical structure through regularization (instead of KL divergence) to ensure SKU-level parameters stay close to the global distribution:
where
Baseline: Predicts base sales from time trend and lagged sales with hierarchical seasonality effects per SKU
Mixed Effect: Computes a macroeconomic scaling factor
Discount: Computes promotional uplift
Volume Conversion: Converts sales predictions to volume using independent conversion parameters
The final sales prediction combines all components:
Given a trained model, the optimizer backpropagates through the frozen network to find the discount allocation
where
Penalty terms