4 ms·
You can implement it, albeit more slowly, in pure python using just 20-30 lines of code. I wrote a blog a while back showing how kmeans can be used to identify
by coleifer 7y ago
You can implement it, albeit more slowly, in pure python using just 20-30 lines of code. I wrote a blog a while back showing how kmeans can be used to identify dominant colors in images. It has many applications and is a handy tool to use for roughly grouping data. Care is needed to pick the optimal starting centroids and k.
- lawlorino 7y ago> You can implement it, albeit more slowly, in pure python using just 20-30 lines of code. This is a good exercise for anyone starting out learning about machine learning, but I'd always stick to a well known library if I was actually using it for something else. > Care is needed to pick the optimal starting centroids and k. Definitely, and I think that speaks to the laziness of the linked article that they just say "Use the elbow method" for choosing k. In my ~4 years of being a data scientist I've never seen or heard of this working for any "real world" problem. Metrics like silhouette scores are much more useful and quantifiable.