# Risk and Pattern Analysis of Pakistani Crime Data Using Unsupervised Learning Techniques
## 4 Results and Discussion
### Cluster Analysis Result
#### 4.1.1 Risk Identification of Possible Criminal Activities from Clustering Solution  
The clustering approach is used to identify crime risks concerning different crime types, locations, and times. Suppose that we have two locations (e.g., A and B) in cluster 1 based on their similarities in attribute values. Let crime types that occurred at location A be {C1, C2, C3, C4} and crime types that occurred at location B be {C1, C2, C3, C5}. So, based on the similarity of {C1, C2, C3} values at both locations, C5 can be predicted for location A as a potential risk and C4 can be identified as a potential risk for location B. However, this would be a weak assumption that can further be validated using the association analysis which is presented in Section 4.2.  
From the clustering solutions shown in Table 4, we have extracted a list of unique groups of related records from each cluster with the help of K-modes clustering algorithm results obtained in a CSV file.  
Table 4 shows some sample records from the cluster which helped in the risk identification of possible criminal activities that can also happen at particular locations.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Attribute** & **Cluster0** & **Cluster1** & **Cluster2** & **Cluster3** & **Cluster4** \\  & **(138)** & **(207)** & **(130)** & **(78)** & **(83)** \\ \hline _Town_ & Mughal Pura & Mustafa Town & Mustafa Town & Johar Town & Mustafa Town \\ _Crime Time_ & Night & After Noon & Morning & Morning & Night \\ _Day Type_ & Weekends & Weekdays & Weekdays & Weekdays & Weekend \\ _Crime Event Location_ & Mughalpura Road & Multan Chungi & Wahdat Road & G1 Market & Abbas Block \\ _Distance of Crime Event_ & 2 km & 1 km & 3 km & 1 km & 3 km \\ _Direction of Crime Event_ & EAST & WEST & NORTH & EAST & SOUTH \\ _from Police Station_ & Robbery & Theft & Fraud & Theft & Robbery \\ \hline \hline \end{tabular}
\end{table}
Table 4: K-modes clustering results of crime events for k = 5.  
Figure 12: Obtained number of clusters (k) using the elbow method.  
The Cluster 0 records present in Table 5 are linked based on the values of the attributes _Crime Time_, _Crime Day_, _Distance of Crime Event from Police Station_, and _Direction of Crime Event from Police Station_. Keeping in account this established link, the risk of occurrence of criminal activities (mentioned in the last column) is identified. For example, in record 1, it has been identified that along with 'Robbery' crime, 'Gambling', 'Fraud', and 'Traffic Violation',are also expected to happen in the 'Multan Chungi' location based on the values of the attributes _Crime Time_ = 'After-Noon', _Crime Day_ = 'Weekdays', _Distance of Crime Event from Police Station_ = '3 km', and _Direction of Crime Event from Police Station_ = 'SOUTH'. The frequency of occurrence of crime Type 'Gambling', 'Fraud', and 'Traffic Violation' is high for the _Crime Time_ = 'After-Noon', _Crime Day_ = 'Weekdays', _Distance of Crime Event from Police Station_ = '3 km', and _Direction of Crime Event from Police Station_ = 'SOUTH'.