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.
Thanks for reading Daily Dose of Data Science! Subscribe for free to learn something new about Python and Data Science every day.
👉 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.