![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/175377/image.jpeg)
How can k-means be applied here?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Image Analyst
le 10 Août 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:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/175377/image.jpeg)
4 commentaires
Image Analyst
le 11 Août 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
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!