# Matching Consignees/Shippers Recommendation System in Courier Service Using Data Analytics
## 4 Case Study
### Implementation
#### 4.2.3 Predicting Possible Matching of Shippers and Consignees Using Decision Tree  
Shippers in Cluster_2 had the greatest potential for new business. However, it was necessary to estimate how many matching pairs could be created with the RS and at what level of accuracy. Decision tree learning was used to discover product delivery behavior and to forecast which groups of customers are likely to acquire various products. The dataset used for the behavioral study was obtained from training and testing data (Figure 2). Training data included the data of 263 consignees who received garment products and clothes over 867 transactions. This data was later used for the creation of the classification model. Testing data included 1435 customers of garment products (those who have never received clothes). The model was validated with 10-fold cross-validation. Model efficiency was determined by the number of correct forecasts made in every class. The model learned and predicted the behavior of customers who had never received clothes with an accuracy of 62.40, resulting in eight forecasting rules (Figure 7).  
Rules were then selected based on the rule's level of confidence, the value of the cluster, and the number of members in a cluster, among other factors. Examples of three rules are as follows:  
* Rule 1: if {Weight > 303.13 kg} then cluster_4
* Rule 7: if {Weight \(\leq\) 303.13 kg} and {Monetary \(\leq\) 24,502 THB} and {Number of customers \(\leq\) 1.5} and {Frequency \(>\) 38} then cluster_2
* Rule 4: if {144.30 kg \(<\) Weight \(\leq\) 303.13 kg} and {Monetary \(\leq\) 24,502 THB} and {Number of customers \(>\) 1.5} then cluster_3  
Figure 6: Scatter plots of clothes shipper clusters for the following variables: (**a**) monetary/number of customers (**b**) monetary/number of product items (**c**) monetary/weight (**d**) monetary/day.  
Rule 1 suggests matching 1 consignee to 13 shippers with confidence level 100%. This rule applies to 'big lot receivers' who receive products with an average shipping weight > 303.13 kg and was suggested to 13 shippers in Cluster_4. These are clothes shippers who send high weight and high-frequency deliveries to a number of customers and with a variety of product items (positioning in rank 2). New consignees with parameters within this behavior range can also be suggested to shippers in Cluster_4.  
Rule 7 suggests matching 1 consignee to 3 shippers with confidence level 100%. This rule applies to 'high-frequency receivers' who receive garment products with average weight < 303.13 kg, with < 24,502 THB spent per year, and with > 2 deliveries/week but a lower weight than the 'big lot receiver group.' This consignee group was suggested for 3 shippers in Cluster_2. These rank 1 clothes shippers send high-frequency, high-weight deliveries, have a high number of customers, and manage a variety of product items. New consignees with parameters within this range of behavior, can be suggested to shippers in Cluster_2.  
Rule 4 suggests matching 6 consignees to 40 shippers with confidence level 60%. It applies to'moderate weight and frequency' consignees who received garment products from > 1 shipper, with an average shipment weight of 144.30-303.13 kg, with < 24,502 THB spent per year. This group was suggested to 40 shippers in Cluster_3. These are clothes shippers who are positioned in rank 3. New consignees positioned within this range of behavior can be suggested to the 40 shippers in Cluster_3.  
Consignees grouped according to Rules 1, 7, and 4 were segmented by F and W, as shown in Figure 8.