How can I drwa lines between k clusters using K-means

7 views (last 30 days)
I have data set with n points and I use K-means for partitioning the data set into k=6 clusters
The resulting clusters shown in this figure
kmeans0.png
How can I Draw lines between these cluster to present each cluster as 2d regions
like this Figure
kmeans.png
  3 Comments
Image Analyst
Image Analyst on 31 Mar 2019
Edited: Image Analyst on 31 Mar 2019
I was going recommend that also, but the lines in voronoi go between points, and if you have the points be the centroids, then I think it might be possible/likely to have lines/regions "contain" points not in that cluster. Moreover these regions would not necessarily be correct for new points. That is, if you have a point in a empty tail of some region, it doesn't necessarily mean that the point would be classified into that cluster if you ran the classification again with the new point. You might want to use boundary - I believe new points in the boundaries would be with the same cluster.
Attach your data so we can try more things.
Walter Roberson
Walter Roberson on 31 Mar 2019
Good point, Image Analyst. If you look near y 30000, x 2000, there is blob split down the middle, and the centroids are going to be in the middle of those masses; there is no way that the voroni lines would happen to follow that split. (Indeed, I don't think kmeans can produce that split; you would need to split along a plane such as svm might do.)

Sign in to comment.

Answers (0)

Categories

Find more on Voronoi Diagram in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!