# Assessment of Thermal Comfort in an Electric Bus Based on Machine Learning Classification
## 2 Materials and Methods
### Data Set  
Overall, 329 personal surveys were collected during the climatic measurements. Figure 2 shows the number of surveys for each value of TS and measurement set. Notice that for the majority of the passengers, TS lied between 0 and 2, as very few passengers perceived the environment as \"cold\" (TS = \(-\)3) to \"slightly cool\" (TS = \(-\)1) or \"hot\" (TS = 3). This results in a low number of data points for each value of TS, which can reduce the modeling accuracy via ML [21]. To overcome this challenge, for this paper only the surveys with TS between 0 and 3 have been considered (284). After data cleansing, 278 surveys are grouped based on the value of TS [22]. Therefore, two groups were created as follows:  
* Group 1: Mild thermal sensation. Value of TS is 0 or 1 (178 surveys) \begin{table}
\begin{tabular}{c c c} \hline \hline
**Parameter** & **Symbol** & **Unit** \\ \hline Air temperature & \(T_{a}\) & \({}^{\circ}\)C \\ Relative air humidity & \(RH\) & \% \\ Air velocity & \(V_{a}\) & m/s \\ Mean radiant temperature & \(T_{r}\) & \({}^{\circ}\)C \\ External air temperature & \(T_{a,out}\) & \({}^{\circ}\)C \\ Age & \(age\) & years \\ Sex & \(sex\) & Male/Female \\ Height & \(h\) & m \\ Weight & \(m\) & kg \\ Clothing insulation & \(l_{cl}\) & Clo \\ Thermal Sensation & TS & ASHRAE scale \\ Position in the bus cabin & \(pos\) & Sector 1 to 6 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Entries of the data set, including the climatic and personal parameters. \begin{table}
\begin{tabular}{c c} \hline \hline
**Value** & **Thermal Sensation (TS)** \\ \hline \(-\)3 & Cold \\ \(-\)2 & Cool \\ \(-\)1 & Slightly cool \\
0 & Neutral \\
1 & Slightly warm \\
2 & Warm \\
3 & Hot \\ \hline \hline \end{tabular}
\end{table} 
Table 2: ASHRAE scale for the evaluation of passengers’ TS. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**MS** & **Date** & **Number of** & **Considered** & **Mean External** \\
**Surveys** & **Surveys** & **Air Temperature** \\ \hline
1 & 26 August 2021 & 132 & 106 & 14.7–20.3\({}^{\circ}\)C \\
2 & 17 June 2022 & 83 & 65 & 17.7–26.5\({}^{\circ}\)C \\
3 & 25 June 2022 & 114 & 107 & 23.5–32.0\({}^{\circ}\)C \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Measurement sets (MS). * Group 2: Warm thermal sensation. Value of TS is 2 or 3 (100 surveys) For modeling, both personal parameters from the surveys and climatic parameters obtained from the measurement stations were considered. To include both information in the data set, the mean values of \(T_{a}\), \(RH\), \(V_{a}\) and \(T_{r}\) were obtained for each measurement and each measurement station. Then, these values were associated with the surveys based on the position of the passengers in the bus. Additional details about the surveys can be found in [5]. To obtain a better understanding in the resulting data set, an exploratory data analysis (EDA) was carried out on all the parameters found in Table 1, with the exception of _pos_. Because _pos_ was already used to associate climatic parameters and personal information. To begin with, the new parameter body mass index (BMI) was calculated from the weight and height using the formula \(BMI=\frac{weight}{height^{2}}\). Height and weight were then substituted by the BMI calculation. Afterwards, unfeasible data were eliminated. We proceeded with a correlation and multicollinearity analysis. The resulting correlation matrix (Figure 3), reveals a strong correlation (>|0.7|) between the parameters: \(T_{a}\), \(RH\), \(T_{r}\) and \(T_{a,out}\). Figure 3: Correlation matrix. Figure 2: Number of surveys for measurement set and thermal sensation value. To analyze the multicollinearity, we used the variance inflation factor (VIF), which can be seen in Table 4. The parameters \(T_{a}\), \(T_{r}\) and \(T_{a,out}\) showed VIF values higher than the recommended value 5.