## ML models used to predict future energy and environmental parameters of retail stores

The Machine Learning (ML) models used to predict both energy needs and future environmental parameters of the some retail stores in Italy

1D Convolutional Neural Network (CNN) to predict future values of temperature, humidity, CO2 level and energy consumption with the objective to timely tune the Heating, Ventilation, and Air Conditioning (HVAC) system so that the desired comfort is obtained with minimal energy consumption. The architecture consists of four layers (see figure):

**Input layer**. The first layer takes as input an n*f array, where n is the duration of the observation time window (expressed in quarters of an hour), and f is the number of features. That is, an input sample consists of the values of f variables, including temperature, humidity and CO2, energy consumption, timestamp HVAC operating parameters, collected during a time window of n quarters of an hour. Each sample is normalised along the temporal axis by using the nominal minimum and maximum values of each variable.**1D Convolutional Layer**. Each sample is operated by a convolutional layer with k filters, each filter of size h*f, with h being the height and f the width of the input sample (i.e., the number of features). Each of these k kernels slides over the input matrix with a step of 1 to extract the temporal properties of the f features. This layer outputs a matrix of size ((n – h + 1) * k), in which i-th column is a feature vector extracted by the i-th filter. The rectified linear activation function (ReLU(x) = max{0, x}) is used to break linearity in the model, as per convention for CNN.**Max Pooling layer**. The max-pooling operation down samples the temporal properties extracted with the convolution by keeping only the largest values. This operation involves a filter that slides along each feature map with a pre-defined step (also called stride) and applies a maximum operator to several elements equal to the pool size parameter. As we set stride equal to pool size, the size of the resulting matrix is equal to (((n – h + 1) * pool_size) * k).**Flatten layer**. It reshapes the output of the max pooling operation into a one-dimensional feature vector.**Output layer**. The vector is processed by a final fully connected layer. The output of this layer is a vector of four elements, with the predictions of indoor temperature, humidity, CO2, and energy consumption for the quarter of an hour that follows the input time window.

*Overview of the input variables*

Table below reports the values of the main hyper-parameters of the AI model. Considering the obtained performance, we use largely the same configuration reported in our previous work, differing only in a couple of parameters: we define different loss weights for the output variables with the aim to balance their contribution equally within the overall loss, and we reduce the maximum number of training epochs to 1000.

Every day after midnight, we train the AI model by using a window of data (i.e., mobile window) collected over the last 30 days. Data is made available thanks to a data collection system, which is necessary to regularly sense the environment through sensors and smart energy meters. The objective of the update mechanism leveraging mobile window is twofold:

- Enabling the model to learn the impact of actuations (ON/OFF, set point) on the indoor environment and energy consumption over the recent period.
- Keeping up with seasonal variations in environmental conditions. Indeed, the same HVAC settings might lead to different effects on the environment under different conditions, e.g., outdoor weather.

*Model parameters*