# Heatwave Damage Prediction Using Random Forest Model in Korea
## 3 Results of Predicting the Number of Heatwave-Related Patients  
### Data Collection and Pre-Processing for Model Training  
The variables and target data are listed in Table 1 with their data sources and renewal cycles. The variables are categorized as static or dynamic. Further, the abbreviations of the variables are used hereafter in the main text, figures, and tables. The static variables were pre-collected from a government agency that manages big data. They are universally updated quarterly and yearly, making them less volatile when predicting the number of heatwave-related patients in summer. In contrast, the dynamic variables, such as floating population and weather information, change with time. In South Korea, big data regarding the floating population are estimated on the basis of mobile big data collected hourly and monthly by SK Telecom's nationwide mobile communication base stations, and the estimated data are obtained from the Statistical Data Center. They are also estimated using public big data and communication data provided by the Seoul Open Data Plaza. Weather data are collected hourly and were provided by the Korea Meteorological Administration (KMA). However, the weather data, particularly those collected from sensors, may have missing values due to sensor defects. To address the problem of missing values, we used datasets consisting of columns with no missing values in order to predict the missing values of other datasets. Target data were based on weekly data obtained from the thermal disease monitoring system managed by KDCA (patients with heat-related diseases and deaths caused by heatwaves in emergency rooms nationwide); \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Variable Description** & **Abbreviation** & **Units** & **Data Source** \\ \hline
**Static variables— socioeconomic and** & & & Korean statistical \\
**demographic data** & & & information service \\  Per capita income & Income & \(\times\)S1000 & \\ Insurance premiums per person & Insurance & \(\times\)S1000 & \\  Resident registration population & RRP & \(\times\)I & \\ Number of vulnerable occupational groups & & & \\ (agricultural, manufacturing, & & & \\ and construction workers) & & & \\ \hline
**Dynamic variables—meteorological data** & & KMA \\  Maximum temperature of the week & Max Tem & \({}^{\circ}\)C & \\  Minimum temperature of the week & Min Tem & \({}^{\circ}\)C & \\  Mean temperature of the week & Mean Tem & \({}^{\circ}\)C & \\  Median temperature of the week & Median Tem & \({}^{\circ}\)C & \\  Variance temperature of the week & Variance Tem & \({}^{\circ}\)C & \\  Mean humidity of the week & Mean Hum & \(\%\) & \\  Mean wind speed of the week & Mean wind speed & m/s & \\ \hline
**Dynamic variables—demographic data** & & & Statistical data center \\  Floating population & FP & \(\times\)I & \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Descriptions of variables to predict the number of heatwave-related patients. data regarding heat-related diseases such as heat stroke, exhaustion, cramps, fainting, and edema were also provided as weekly data. The resolution of the entire dataset was unified through considering the data properties of the features and targets; the temporal resolution was set to 1 week, and the range resolution was set on the basis of the South Korean administrative divisions. The datasets were randomly used for classification--80% were used as learning data and the remaining 20% as test data. Finally, variables were normalized before being inputted into the RF model to avoid creating a model that depends on specific variable units owing to the different ranges of each variable. All variables were confirmed using the Boruta algorithm. The contribution of each variable to the RF prediction model is shown in Figure 2. The edges of each box represent the quartiles, and the line through each box represents the median. Each bar represents the 1.5 interquartile range of the nearer quartile, and the open circles represent outliers.