How can k-means be applied here?
3 views (last 30 days)
Show older comments
Hi,
Let me share my problem
I have few rectangular shapes boxes with specific height and width. Now, I have to cluster them so that the similar size boxes could be in one cluster and different size boxes shall be in another cluster. Now, if the longer side of a rectangle ( width or height) or the area s widely varies then boxes shall be dissimilar.
suppose I have a box with dimension ( 4*1) (width * height) and another box (1*4) (width * height), now both of them have same area but they have to be in different cluster. Now, if I am given a set of rectangle with (width * height) how can I apply k-means to them to clusterize, there are my doubts?
any approach from where I can start ?
regards
0 Comments
Answers (1)
Image Analyst
on 10 Aug 2014
I don't think kmeans can work with your boxes. Plus even if you manually scan your scatterplot looking for max values in your box, so that you can determine it's location, it depends on the order you use your boxes, like whether you do three 4*1 first then two 1*4 or vice versa.
If you have a lot of scatterpoints, you can turn it into an image and use quad tree decomposition, qtdecomp() in the Image Processing Toolbox:
4 Comments
Image Analyst
on 11 Aug 2014
I don't have the stats toolbox so I can't try kmeans. If you don't know the number of clusters, try one of the machine learning methods listed here: http://www.mathworks.com/machine-learning/index.html
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!