MATLAB Answers


Cluster data around lines of unit slope

Asked by Muhammad Saafan on 10 Nov 2019 at 7:19
Latest activity Commented on by Image Analyst
on 11 Nov 2019 at 0:51
How I can cluster the points in the attached chart around LINES with UNIT SLOPE.


Image Analyst
on 10 Nov 2019 at 16:46
Use least squares formula, you know Y\X, and matrix division (NOT polyfit because you need it to go through the origin). Then you'll have the average slope going through the origin. Then just add various offsets to get the vertical shifts you desire. Attach your data in a .mat file if you need more help.
I need to divide the data points into clusters. Each cluster will be defined by a line of unit slope.
In K-means, the clustering process is around a centroid which is a single point. Is there any way to do the same but a round lines?
Image Analyst
on 11 Nov 2019 at 0:51
Sure you can. If you tell it to find 2 clusters, then it will be forced to find two clusters, regardless if those clusters even look like reasonable clusters. I don't even see any well delineated clusters in there.
Maybe you'd rather use a support vector machine (SVM) instead of kmeans(). See this wikipedia link

Sign in to comment.




0 Answers