Pre-Investment Impacts
Introduction
The revenue data as predited by our model depends on several factors. Some of them have multiplicative influence such as distribution, temperature, pricing etc. while impacts from investments are additive in nature.
The investments data available to us is post 2020 while rest of the dataset we have is from 2017. If the model is allowed to attribute revenue from 2017 to all these factors, then these factors are biased to learn higher weights pre 2021 and then try to overpredict the revenue from 2021 onwards because of the presence of investments. Hence we might get misleading revenue attributions and hence misleading recommendations because of the model being unstable.
In order to mitigate this phenomenon, we need a basic substitute for investment impacts pre 2021 which can not only help in balancing out the weights of other features and making the model stable, but can also help the model recover from sudden shocks in predictions from 2021 by uncovering a general revenue trend.
How Pre-Investment Layer Works?
- We start by initial best fit slope and intercept parameters of a linear line that will minimize the
mean squared error
loss for predicting the revenue. This is done inwholesaler_processing_utils.py
. - The pre-investment layer is then allowed to learn some deviations on these initial slopes and intercepts based on the weights of the remaining layers such that the impacts at the end of the pre investment period do not deviate significantly from having no impacts. This is done for each wholesaler X brand in isolation.
- These impacts are then multiplied on baseline like other multiplicative impacts.
Pseudo Code
Impact Visualization and Explanation
As seen above, the presence of pre-investment layer allows the model to accurately capture the sales trend pre 2021 and then the model predictions progress smoothly from there post 2020 for Mich Ulta in California preventing the model from overpredicting the sales post 2020.