A Visual Comparison Between Locality and Density-based Clustering
The biggest limitation of locality-based clustering.
The utility of KMeans is limited to datasets with spherical clusters. Thus, any variation is likely to produce incorrect clustering.
Density-based clustering algorithms, such as DBSCAN, can be a better alternative in such cases.
They cluster data points based on density, making them robust to datasets of varying shapes and sizes.
The image depicts a comparison of KMeans vs. DBSCAN on multiple datasets.
As shown, KMeans only works well when the dataset has spherical clusters. But in all other cases, it fails to produce correct clusters.
Find more here: Sklearn Guide.
👉 Read what others are saying about this post on LinkedIn and Twitter.
👉 If you liked this post, leave a heart react 🤍.
👉 If you love reading this newsletter, feel free to share it with friends!
Find the code for my tips here: GitHub.
I like to explore, experiment and write about data science concepts and tools. You can read my articles on Medium. Also, you can connect with me on LinkedIn and Twitter.