# Root Cause Attribution of Delivery Risks via Causal Discovery with Reinforcement Learning
## 3 Experiments
### Experimental Data
#### 3.1.2 Explanatory Data Analysis  
Figure 3 provides an initial overview of the \"Late_delivery_risk\" (\(X_{7}\)) variable within the dataset, which is essential for our exploratory data analysis (EDA) before proceeding with causal discovery through reinforcement learning for root cause attribution. The first chart presents a countplot of late delivery risks, indicating that instances of late deliveries ('1') slightly exceed on-time deliveries ('0'), suggesting that delivery delays are a prevalent issue in this dataset. The second chart, a scatter plot, examines the relationship between actual shipping days and scheduled shipping days, with different colors representing the presence or absence of late delivery risk. The clustering of late deliveries around certain combinations of scheduled and actual shipment days hints at underlying patterns contributing to these delays. Together, these visualizations provide key insights into where delays are concentrated, laying the groundwork for the causal analysis to follow. Figure 4 further enhances our exploratory data analysis (EDA) by offering key insights into delivery performance and customer segmentation, which are crucial for understanding factors influencing late delivery risks. The bar chart on the left (a) shows the distribution of delivery statuses across the dataset, with \"Late delivery\" being the most frequent outcome, significantly outnumbering \"Advance shipping\", \"Shipping on time\", and \"Shipping canceled\". This indicates that delays are a pervasive issue, making it a central focus for our causal analysis. The high occurrence of late deliveries suggests potential systemic issues, which could be explored further by examining other variables in the dataset. For instance, we hypothesize that Delivery Status (\(X_{6}\)) could be a key causal factor contributing to late deliveries. The pie chart on the right (b) provides a breakdown of orders by customer segment (\(X_{8}\)). The majority of orders come from the \"Consumer\" segment (51.8%), followed by \"Corporate\" (30.4%), and \"Home Office\" (17.9%). This segmentation is important for our analysis, as it may reveal segment-specific factors influencing delivery delays. While it is crucial to understand the different behaviors and risks associated with each segment, we have reservations about whether the customer segment directly causes late delivery. Although segments may impact shipping times, they might not be a direct causal factor for late deliveries, which will be explored in the subsequent causal analysis. The heatmap visualization in Figure 5 presents the correlation matrix for key features in the dataset. Each cell in the matrix represents the correlation coefficient between two features, with the color intensity indicating the strength and direction of the correlation. Several important patterns emerge from this visualization. For example, \"Days for ship  
Figure 3: Analysis of late delivery risk. ment (scheduled)\" (\(X_{3}\)) and \"Shipping Mode\" (\(X_{16}\)) display a strong positive correlation (0.92), suggesting that the shipping mode may significantly influence, or be influenced by, the scheduled shipment days. Likewise, \"Sales per customer\" (\(X_{5}\)), \"Order Item Total\", and \"Sales\" are highly correlated, indicating potential redundancy among these features. Figure 4: Delivery status and customer segments. Figure 5: Correlation matrix. Of particular relevance to our study on late delivery risks, the \"Late_delivery_risk\" (\(X_{7}\)) variable shows a moderate negative correlation with \"Days for shipment (scheduled)\" (\(X_{3}\)) (\(-0.37\)) and a positive correlation with \"Delivery Status\" (\(X_{6}\)) (0.19). This suggests that shorter scheduled shipment times may be associated with a higher likelihood of late deliveries and that delivery status plays a significant role in explaining delays. Understanding these correlations is critical as we move toward applying causal discovery with reinforcement learning.