# Forecasting Daily Temperatures with Different Time Interval Data Using Deep Neural Networks
## 4 Data
### Experimental Setup  
Several factors may affect the accuracy of temperature forecasting with neural networks, so we employed neural a network with the following four parts:  
* **Model structure**: We selected three neural network models to compare models their suitability for the temperature forecasting. The models we tested were MLP, LSTM, and CNN. * **Time unit of input data**: We selected two different units of input data to predict daily temperatures for comparison: daily, which was the same as the target data, and hourly, which was more detailed than the target. * **Length of input data**: We selected five separate lengths of input data to determine the lengths of historical data needed to forecast the next-day temperature. The data lengths were 1 day and 3, 5, 10, and 30 days. * **Region**: We selected three regions in South Korea to understand the impacts of regional characteristics on temperature forecasting: Seoul as a metropolitan area, Daegwalleong as a mountainous area, and Seongsan as a coastal area. Figure 4: Box plots of the best performance among the different input lengths in the metropolitan area, Seoul. Figure 5: Box plots of the best performance among the different input lengths in the mountainous area, Daegwalleong. Figure 6: Box plots of the best performance among the different input lengths in the coastal area, Seongsan. We summarize the factors and levels for each vector in Table 14. Note that each model performs the pointwise forecasts for the location of the AOSG station in each region, and the input variables collected only from the station that corresponds to the target variable were used for these tasks. The structures of actual input and target data used in the experiments are as follows. First, both daily and hourly input data are constructed by employing the data described in Sections 4.3.1 and 4.3.2, respectively. An hourly data contains 15 weather variables for every hour in the length of input data and a daily data contains these variables for every day. For MLP, an input is flattened to a vector with the length of the number of weather variables, 15, multiplied by the time steps, the length of input for daily data and 24 times of the length of input for hourly data. LSTM receives a sequence with the length of the time steps and each element of the sequence is a vector containing the weather variables. Finally, for CNNs, an input data is a two-dimensional matrix whose dimensions correspond to the number of weather variables and the number of time steps. For instance, for the temperature forecasting using three days of hourly data, an input instance contains 1080 numerical weather values with 15 weather variables for 72 time steps. The input for MLP model is a 1080-dimensional vector, that for LSTM is a sequence of 15-dimensional vectors whose length is 72, and that for CNN is a rectangular matrix whose size is 72 by 15. Second, the target variables are the daily average, minimum, and maximum temperature after one day of the inputs. The details of the experimental setup are as follows. We divided the entire ten years of data into batches of six years of data, two years of data, and another two years or data in sequential order to prevent information leakage [3; 43; 36]. We then used these three batches as training, validation, and test data, respectively. Since we employ information of several previous days from the target date, target values in the test data set may be used as inputs in training or validation data sets if we randomly split training, validation, and test sets. After splitting data sets, we randomize the order of instances in the training set. To optimize our models, we used an adaptive moment estimation optimizer with a learning rate of 0.00005 and set the mini-batch size to 4. To prevent over-fitting, we performed early stopping using the validation data set. All of the activation functions are in rectified linear units.