# Transformer-Based Hybrid Forecasting Model for Multivariate Renewable Energy
## 3 H-Transformer
### Data  
This work uses five renewable energy time series (two sets of solar energy and three sets of wind speed) to assess the performance of the proposed hybrid system in the forecasting task.  
The first dataset of solar energy (named \(Solar1\)) is composed of data obtained from a solar panel installed in the Northeast region of Brazil over a total period of one year--between the beginning of July 2018 and the end of July 2019 [31]. The dataset is composed of two files: (i) Weather data from the exact location of the solar panels, taken every minute, totaling 570,281 observations and 35 features; (ii) Data with the solar panel information, such as energy generated, taken every 15 min, totaling 38,016 observations and 18 features. These data contain null observations between 6 pm and 6 am each day and from mid-April 2019 to mid-June 2019.  
The Second Dataset (\(Solar2\)) is composed of data obtained from a solar panel installed in India over a total period of 34 days, with observations of multiple panels every 10 min [32]. This dataset is also composed of two files, and the information of each file is as follows: (i) Weather data from the exact location of the solar panels and only three features; (ii) Data with the generated energy of multiple solar panels and one feature per solar panel.  
The following Datasets (\(Wind1\), \(Wind2\) and \(Wind3\)) are composed of data obtained hourly from a wind turbine in three different regions of Northeast of the Brazil (Recife, Natal, and Fortaleza) over a total period of 1 month. Each dataset is composed of a single file containing the weather data from the exact location of the wind turbines, as well as the wind speed (target).  
Preprocessing  
Both datasets (\(Solar1\) and \(Solar2\)) were resampled at 1-hour intervals, merged with their respective weather datasets, and finally cleaned of all null observations. For \(Solar1\), all extra features of the solar panel data were removed, except for the power generation feature, which was used as a target for the regression of the nonlinear Models. In the case of \(Solar2\), the mean of all solar panels' generated energy was used for the target of the regression nonlinear, and all other features were removed. The wind speed datasets were already in the correct schema up to this point.  
A \(shift\) operation is computed to transform each observation to contain the information of its previous \(n\) timesteps, or number of lags. The choice of possible options for \(n\) was defined by the highest observations on each dataset's autocorrelation function (ACF).  
The resulting datasets (described in Table 2) were divided into Training, Validation, and Test sets. The three sets were normalized using the min-max method described by Equation (6). \(Y_{i}^{t}\) is the normalized version of the \(Y_{i}\) data, where \(min(Y)\) is the minimum occurrence and \(max(Y)\) is the maximum occurrence in the Training data. The values of the transformed data are in the range \([0,1]\) based on the training set. The normalization is done on each exogenous variable and target time series.  
\[Y_{i}^{t}=\frac{Y_{i}-min(Y)}{max(Y)-min(Y)}, \tag{6}\]  
where \(Y\) is the list containing all values of an exogenous variable or time series under analysis.  
\begin{table}
\begin{tabular}{c c c c c c} \hline  & \(Solar1\) & \(Solar2\) & \(Wind1\) & \(Wind2\) & \(Wind3\) \\ \hline Observations & 4020 & 273 & 744 & 720 & 744 \\ Features & 39 & 3 & 4 & 4 & 4 \\ Frequency & 1 h & 1 h & 1 h & 1 h & 1 h \\ Lags & 3, 6, 12, 24 & 3, 6, 12 & 1–12 & 1–12 & 1–12 \\ \hline \end{tabular}
\end{table}
Table 2: Description of the resulting datasets after the preprocessing steps.