How can k-means be applied here?

조회 수: 3 (최근 30일)
joy
joy 2014년 8월 10일
댓글: Image Analyst 2014년 8월 11일
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

답변 (1개)

Image Analyst
Image Analyst 2014년 8월 10일
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
joy
joy 2014년 8월 11일
along x axis I can plot the ratio of (shorter side/longer side) of all given rectangles, in y axis I can plot the area of all given rectangles, then the generated scatterplot can be used for clustering?
any views on this? is this could be an approach?
Image Analyst
Image Analyst 2014년 8월 11일
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

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by