# The Use of Machine Learning Methods in Road Safety Research in Poland
## 3 Analysis of Variables Describing Road Safety
### Characteristics of Selected Variables  
Taking into account the extracted variables, an in-depth analysis was conducted to identify patterns and trends characterizing road traffic incidents in Poland, focusing on the injury levels sustained by participants and the number of casualties. In Poland, passenger cars are most often involved in traffic incidents, reflecting their prevalence and popularity among citizens. The vast majority of such cases result in no health consequences for participants. However, a significant number of incidents still lead to severe injuries or fatalities, highlighting the need for safer private transportation systems. The results for other types of vehicles are far better. Notable is the frequency of incidents \begin{table}
\begin{tabular}{c c c c c c} \hline
**Actual Class** & **No Injuries** & **Minor Injuries** & **Severe Injuries** & **Deaths** & **Class. Error [\%]** \\ \hline No injuries & 21,328 & 1962 & 161 & 25 & 9.15 \\ Minor injuries & 4754 & 12,771 & 1129 & 108 & 31.93 \\ Severe injuries & 1621 & 5747 & 1060 & 117 & 87.60 \\ Deaths & 530 & 1224 & 284 & 210 & 90.66 \\ \hline \end{tabular}
\end{table} 
Table 4: Confusion matrix for the Random Forest model with a reduced number of variables. Figure 2: Mean decrease Gini for the selected variables. involving heavy trucks; however, due to their greater weight and elevated driver positions, they mostly end with no injuries. A frequency heatmap for the \"vehicle type\" variable in terms of the number of road traffic incidents and their consequences for participants is shown in Figure 3.  
Driver behavior significantly influences the number and severity of road traffic incidents. In Poland, many accidents are caused by speeding or failing to yield the right of way, often leading to severe injuries or, in extreme cases, even fatalities. Fewer incidents stem from behaviors like driving on the wrong side of the road or inadequate vehicle lighting, although these can also have serious consequences. It should be emphasized that many incidents occur even when drivers behave appropriately. While most of these do not result in health consequences, there are cases of severe injuries and fatalities. A frequency heatmap for the \"driver behavior\" variable in terms of the number of road traffic incidents and their consequences for participants is shown in Figure 4.  
Poland's 16 administrative regions (voivodeships) exhibit varying numbers and severities of road traffic incidents. The highest number of incidents was recorded in the Mazowieckie, Malopolskie, Lodzkie and Slaskie voivodeships, often resulting in no health  
Figure 4: Frequency heatmap for the “driver behavior” variable in terms of road safety in Poland. Figure 3: Frequency heatmap for the “vehicle type” variable in terms of road safety in Poland. consequences or minor to severe injuries. In contrast, the Lubuskie, Podlaskie, and Opolskie vovodeships reported the fewest incidents, correlating with lower casualty numbers. These disparities may result from differences in the traffic density and road infrastructure, including access to expressways and highways. A frequency heatmap for the \"voivodeship\" variable in terms of the number of road traffic incidents and their consequences for participants is shown in Figure 5.  
Another crucial variable in terms of road safety is the type of incident, as participants can sustain varying degrees of injury depending on the specific road situation. In Poland, the most frequent incidents are side vehicle collisions, which in most cases have no impact on health or result in minor, or occasionally serious, injuries. Rear-end collisions are also quite common, typically leading to few or no health consequences. Particularly hazardous are head-on collisions and pedestrian accidents, as these categories are characterized by a high frequency of severe injuries and fatalities. Conversely, collisions with stationary vehicles are the least recorded, indicating a lower likelihood of such incidents occurring on Polish roads.