Discover more from Daily Dose of Data Science
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.
👉 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.