## 2 Materials and Methods
### Data Collection and Preprocessing
#### 2.3.1 Data Preprocessing
\begin{table}
\begin{tabular}{c c c c} \hline \hline \multirow{2}{*}{**Configuration**} & **Input Window** & **Sampling Step** & **Number of** \\  & **(Hours)** & **(Hours)** & **Outputs** \\ \hline Config 1 & 64 & 8 & 2 \\ Config 2 & 128 & 16 & 4 \\ Config 3 & 256 & 32 & 8 \\ Config 4 & 512 & 64 & 16 \\ \hline \hline \end{tabular} Note: These configurations were implemented as separate sub-models in the slideNN architecture and as adjustable hyperparameter scenarios within a single GRU model.  
\end{table} 
Table 3: The input–output configurations used across both model architectures. Each configuration represents a specific combination of the input window size and prediction horizon applied to both slideNN and GRU models. where \(\mu_{Y}\) and \(\sigma_{Y}\) are the mean and standard deviation of the AQI values across the training targets, respectively. Standardizing the output proved to be a crucial step in reducing prediction errors and stabilizing the training process [65]. Without standardization, the models exhibited significantly higher loss fluctuations and slower convergence, particularly when predicting multiple future time steps with higher variability in AQI levels. Given that both the input features and the output values span entirely different average value ranges and measurement units, insufficient preprocessing will naturally lead--just as observed--to particularly high prediction errors and poor model generalization. Initially, only the input features were normalized and/or standardized, but the prediction loss remained notably high. Once output AQI values were also standardized, model performance improved significantly, enabling more effective learning and better predictive accuracy. For a deeper understanding of the diversity in scales and measurement units among the variables, Table 4 was constructed, which presents the typical value ranges for each variable that was used in this study [7; 15; 16; 66]. These ranges are based on international standards and scientific literature, supporting the rationale for proper data preprocessing prior to model training. To maintain the integrity of the temporal structure within our dataset and to prevent any potential data leakage, we approached the division of training and validation data with careful consideration. Although the Keras framework offers a convenient validation_split parameter, its improper use can lead to leakage if the data are shuffled prior to splitting. To address this risk, we specifically set shuffle = False when training the model. This ensures that the validation set consistently comprises the most recent 20% of the data, while the training set is formed from earlier entries. This approach effectively preserves the chronological sequence of the time series, allowing the model to utilize only past data when predicting future values. As a result, we upheld the integrity of the forecasting task and prevented any occurrences of temporal leakage. After completing the data preprocessing phase, a final reshaping step was applied to convert the input data into a format compatible with each of the two different architectures. Initially, the input was structured as a sequence of rows, where each row corresponded to a single hourly observation and included the eight known variables.