# Robust Sales forecasting Using Deep Learning with Static and Dynamic Covariates
## 3 Empirical Study
### Features Engineering  
There are two distinct types of features: sequential and categorical. Sequential features are represented as two-dimensional real-value data, encompassing both the time and channel dimensions. These sequential features are directly fed into the network without any additional manipulation. On the other hand, categorical features undergo an embedding process before being fed into the network. During this process, the network learns embeddings through an embedding layer, which serves as a lookup table, mapping input values to trainable embeddings [24]. Four distinct feature groups were taken into consideration: time-related features, price-related features, event-related features including SNAP days, and identification-related (ID) features. The first three groups of features are sequential, while the last group is categorical. Regarding time-related features, eight different value types were used: day, month, year, week of the month, week of the year, day of the year, weekday, and weekend indicator. Following the recommendation by [9], all of these values, excluding the final one, were encoded to the range of \([-0.5,0.5]\). The weekend indicator was encoded as a binary feature. For instance, in terms of the day values, day 1 is represented as the encoded  
Figure 5: Distribution of the weekly average prices within each category’s departments for each year from 2011 to 2016 (\(X\) axes on a logarithmic scale). From left to right, we have the Foods category’s departments: Foods1 in pink, Foods2 in light green, Foods3 in dark green; Hobbies departments: Hobbies1 in pink, Hobbies2 in light green; Household’s departments: Household1 in pink, Household2 in light green. value \(-0.5\), day 2 as \(-0.4666667\), day 29 as 0.43333333, day 30 as 0.4666667, and day 31 as 0.5. Similarly, for the weekday, Monday is encoded as \(-0.5\), Tuesday as \(-0.33333333\), Wednesday as \(-0.1666667\), Thursday as 0, Friday as 0.1666667, Saturday as 0.3333333, and Sunday as 0.5. Three normalized price features were utilized, with normalization achieved through a standard score, i.e., price values were divided by the standard deviation after the mean value was subtracted. The first normalized price value was obtained for each item across all time, considering the disparities from the mean price. The second normalized price value was calculated within each item group that belonged to the same department, allowing for comparisons of the relative price of each item. In each item group associated with the same store, we computed the third normalized price value. This calculation allowed us to make relative price comparisons for each item. We used three values representing the SNAP days from the M5 dataset, which is a binary feature indicating whether the three states permit SNAP purchases on specific dates, without making any changes to them. The calendar events, characterized by two-dimensional features with varying values based on time, underwent a similar encoding process, scaled to fit within the range of \([-0.5,0.5]\) prior to being input into the network. Each event is defined by both its name and type.