## 5 Case Study
For the local machine learning models, we perform feature selection selecting top K features based on their mutual information [126]. \[k\leq\sqrt{N} \tag{2}\]  
\(k\) represents the maximum number of features used to train a model to avoid overfitting. \(N\) represents the number of data instances available in the train set. The equation is based on research done by [125]. Several kinds of preprocessing have been tried for GTSMLFMs in the scientific literature. [PERSON] [127] applied on the fly preprocessing to remove level and seasonality components. [PERSON] et al. [128] found that binning proved to be useful in almost all the cases they analyzed. [PERSON] et al. [13] understands that differences in magnitudes and variances can be removed, either by standardizing the time series or using dimensionless dependent variables. [PERSON] et al. [129] describe applying a local normalization, deseasonalization, and log transformation to the features. Finally, [PERSON] et al. [27] describes scaling the features by their average value. In our case, we opted to scale the values of a feature vector between zero and one by dividing the entries by the maximum value observed in the period of interest. Such scaling forced most feature values to a standard interval between zero and one, helping the model learn similar patterns, regardless of the original time series magnitudes. To further ease the learning process to the model, we scaled the target values too. \begin{table}
\begin{tabular}{l c c c c c c c c c} \hline \hline \multirow{2}{*}{**Dataset**} & \multicolumn{3}{c}{**Original**} & \multicolumn{5}{c}{**Reduced Dataset**} & \multirow{2}{*}{**Test Window**} \\ \cline{2-2} \cline{4-9}  & \# TS & \% TSDM & \# TS & \# TSDM & TS Datapoints & \# Instances & Mean (Target) & Std (Target) \\ \hline
**M4 CD** & 47,983 & 55 & 2000 & 1097 & 45 & 90,000 & 0.6598 & 0.4036 & 12 \\ \hline
**KWWTFCD** & 145,063 & 74 & 2000 & 1488 & 56 & 112,000 & 0.4782 & 0.3442 & 14 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Descriptive data for the M4 CD and KWWTFCD datasets. TSDM is used as an abbreviation for time series with values of different orders of magnitude, while TS abbreviates time series. \begin{table}
\begin{tabular}{l l l} \hline \hline
**Feature** & **Data Type** & **Description** \\ \hline
**min\_n** & Double & Minimum value in rolling window of last \(n\) observations. \\ \hline
**mean\_n** & Double & Mean of values in rolling window of last \(n\) observations. \\ \hline
**std\_n** & Double & Standard deviation for values in rolling window of last \(n\) observations. \\ \hline
**median\_n** & Double & Median value in rolling window of last \(n\) observations. \\ \hline
**skew\_n** & Double & Skew value in rolling window of last \(n\) observations. \\ \hline
**kurt\_n** & Double & Kurtosis value in rolling window of last \(n\) observations. \\ \hline
**peaks\_n** & Integer & Count the number of peaks for a rolling window of last \(n\) observations. \\ \hline
**above\_mean\_n** & Double & Count the number of datapoints above the mean, for a rolling window of last n observations. \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Description of features we created for each dataset. We used \(n=3\), 5, 7, 12. Outlier detection was performed considering a time series comprised of the original time series data points up to the start of the forecasting horizon and then adding the forecasted value, since we only performed one step ahead forecasts (see Figure 4). Doing so enables us to use multiple anomaly detection approaches to evaluate aspects under which a particular value can be considered an outlier within the time series.