Akshay πŸš€
Akshay πŸš€

@akshay_pachaar

6 Tweets 10 reads Jun 05, 2023
K-Means++ from scratch using Python πŸ”₯
K-Means++ has a smarter way to initialise cluster centroids & is much more robust than K-Means βœ”οΈ
-- step by step explanation with code --
A Thread πŸ§΅πŸ‘‡
First of all, we create a sample data for clustering.
We'll use `make_blobs` from sklearn to do so.
Check this out πŸ‘‡
Initialising the cluster centroids is a key challenge in KMeans.
KMeans++ starts by selecting random centroid.
Then uses a probability-based approach to select next centroid that is far away from the previously chosen centroids.
This makes the initialization spread out.
Let's apply K-Means++ to the data we just created! πŸš€
Here we go!πŸ‘‡
That's a wrap!
If you interested in:
- Python 🐍
- Data Science πŸ“ˆ
- Machine Learning πŸ€–
- MLOps πŸ› 
- NLP πŸ—£
- Computer Vision πŸŽ₯
- LLMs 🧠
I'm sharing daily content over here, follow me β†’ @akshay_pachaar if you haven't already!!
Cheers! πŸ₯‚

Loading suggestions...