# The Use of Machine Learning Methods in Road Safety Research in Poland
## 3 Analysis of Variables Describing Road Safety
### Characteristics of Selected Variables
In the \"minor injuries\" category, the speed distribution is broader, reflecting greater variability in the circumstances of the incidents. For \"severe injuries\", the interquartile range significantly widens, while for \"deaths\", both the interquartile range and the median increase, highlighting the significant role of higher speeds in road incidents. The results are illustrated in the box plot (Figure 10). Figure 2:4 Frequency heatmap for the “day of week” variable in terms of road safety in Poland. Figure 2:5 Frequency heatmap for the “place of accident” variable in terms of road safety in Poland. There is a clear relationship between the number and severity of accidents and the prevailing lighting conditions. During the analyzed period, the highest number of road incidents occurred during daylight hours. Most of these incidents resulted in no injuries to participants, largely due to the improved visibility and greater predictability of road conditions. However, daytime conditions also accounted for the highest proportion of accidents involving injuries or fatalities, as the traffic volume is significantly higher during the day. At night, on lighted roads, the number of incidents is noticeably lower. These situations mostly result in no injuries or minor injuries, although severe injuries do occur occasionally. The lowest number of traffic accidents occurs at night on unit roads. However, the consequences of these incidents are particularly severe, as such conditions often lead to serious injuries or fatalities. A frequency heatmap for the \"lighting\" variable in terms of the number of road traffic incidents and their consequences for participants is shown in Figure 2:6  
Another variable considered in this study is sex. In Poland, men are significantly more often involved in road incidents, especially those that result in no injuries or minor injuries. When incidents involve women, they typically result in minor injuries. Notably, men experience a higher frequency of fatal incidents compared to women. This could suggest their  
Figure 2:7 Frequency heatmap for the “lighting” variable in terms of road safety in Poland. Figure 2:8 Box plot of the severity of road traffic incidents in Poland depending on the speed limit. greater participation in traffic, differences in driving styles, and, consequently, a potentially higher exposure to risk. A frequency heatmap for the \"sex\" variable in terms of the number of road traffic incidents and their consequences for participants is shown in Figure 2:9  
The number of road incidents in Poland is also influenced by pedestrian behavior, which in extreme cases can pose risks to health and life. Interestingly, the highest frequency of incidents is observed in cases where the pedestrian behaves correctly. These incidents most often result in minor or severe injuries, although fatalities are also frequent. This indicates that even when following the rules, pedestrians in Poland face numerous hazardous situations due to interactions with vehicle traffic. The second most common incidents are related to careless entry onto the roadway in front of moving vehicles. These incidents predominantly result in minor and severe injuries, although the number of fatalities is also relatively high. For other pedestrian behaviors, the statistics for hazardous incidents are significantly lower, with less variation in the level of injuries and fatalities. A frequency heatmap for the \"pedestrian behavior\" variable in terms of the number of road traffic incidents and their consequences for participants is shown in Figure 3.0  
Figure 3.1 Frequency heatmap for the “sex” variable in terms of road safety in Poland. Figure 3.2 Frequency heatmap for the “pedestrian behavior” variable in terms of road safety in Poland. Based on the selected and described 11 variables, the next section of this article presents the mathematical modeling of road safety in Poland using machine learning algorithms.