## 6 Complex Task: Generating Code for an LSTM Model
\begin{table}
\begin{tabular}{l c c c} \hline \hline  & **Temperature** & **Relative Humidity** & **Wind Speed** \\ \hline MSE & 0.1214 & 1.1871 & 0.4642 \\ MAE & 0.2838 & 0.7619 & 0.5100 \\ MB & \(-\)0.2321 & \(-\)0.2048 & \(-\)0.1410 \\ MAPE (\%) & 1.3938 & 1.0432 & 9.5998 \(\times\) 10\({}^{8}\) \\ MFE (\%) & 1.4161 & 1.0417 & 2.24889 \(\times\) 10\({}^{5}\) \\ MFB (\%) & \(-\)1.1641 & \(-\)0.2316 & \(-\)14.1026 \\ R\({}^{2}\) & 0.9675 & 0.9861 & 0.8457 \\ Pearson \(r\) & 0.9910 & 0.9949 & 0.9235 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Error metrics for temperature, relative humidity, and wind speed as calculated by the OAI1-generated LSTM model. The MAPE for wind speed is once again incorrect due to division by a very small number close to zero. By examining the error metrics for all three variables, we can conclude that the OAI3-generated model also predicted the three variables with reasonable accuracy. The OAI3 framework provided a satisfactory response after two attempts and two queries, with no SB responses recorded. Detailed comparisons with the ground truth for each variable follow. ### Lstm-H

After running the LSTM-H model and obtaining predictions for the test data set for each of the three variables, we compiled Table 7 containing all error metrics, specifically MSE, MAE, MB, MAPE, MFE, MFB, R\({}^{2}\) score, and the Pearson correlation coefficient \(r\). In our code implementation, we avoided division by zero when calculating MAPE and MFE, since we explicitly excluded these lines from the calculations. The comparisons of the predictions from the LSTM-H model and the three frameworks against observations (i.e., ground truth) are presented in Figures 4-6 for temperature, relative humidity, and wind speed, respectively. All predictions from LSTM models generated by GPT, OAI1, or OAI3 appear to be remarkably close to those of LSTM-H for the testing data set and align well with observations, particularly in the cases of temperature and relative humidity. Figure 4: Temperature predictions from all three models and comparisons with ground truth and LSTM-H predictions. LSTM_H is the model developed by the authors, LSTM_GPT is the GPT-generated model, LSTM_OAII is the OAII-generated model, and LSTM_OAI3 is the OAI3-generated model. The (**top**) graph represents the entire testing data set. The two bottom graphs concentrate on specific time intervals, specifically between 100 and 200 ten-minute intervals (**bottom left**) and 4100 and 4200 ten-minute intervals (**bottom right**). This is implemented to better visualize the difference between the various predictions. Figure 5: Relative humidity predictions of all three models and comparisons with ground truth and LSTM-H predictions. LSTM_H is the model developed by the authors, LSTM_GPT is the GPT-generated model, LSTM_OAII is the OAI1-generated model, and LSTM_OAI3 is the OAI3-generated model. The (**top**) graph is for the whole testing data set. The two bottom graphs focus on specific time intervals, namely between 100 and 200 10 min intervals (**bottom left**) and 4100 and 4200 10 min intervals (**bottom right**). This is implemented to better visualize the difference between the different predictions. As MAPE and R\({}^{2}\) scores are reliable metrics for error calculations (due to their scale independence and interpretability), we independently calculated the MAPE and R\({}^{2}\) scores for the three predicted variables from the GPT-generated model. We also calculated MAPE and MFE for wind speed between the ground truth and predictions from the OAI1 and OAI3 frameworks, as not all of their calculations were performed correctly. The results are presented in Tables 8 and 9. Figure 6: Wind speed predictions of all three models and comparisons with ground truth and LSTM-H predictions. LSTM_H is the model developed by the authors, LSTM_GPT is the GPT-generated model, LSTM_OAI1 is the OAI1-generated model, and LSTM_OAI3 is the OAI3-generated model. The **(top)** graph is for the whole testing data set.