The Clustering Model
In this exercise, we will use the KMeans clustering algorithm to identify patterns in crime locations based on their latitude and longitude. Clustering can help reveal spatial patterns that are not immediately obvious.
Extract and Sample
The result should look something like this:

Train the model
The KMeans algorithm requires us to specify the number of clusters (k
). A good way to determine the optimal k
is by using metrics like inertia and the silhouette score.
The result should look look something like this:

How does your plot look? What is the optimal k
? The silhouette score helps identify the number of clusters that best separate the data points.
Cluster the Data
Once you've chosen the optimal number of clusters:
Last updated