automatic circles that enclose clusters of similar data something like lineCoeff = polyfit(x, y, n) (regression line)

1 回表示 (過去 30 日間)
Neo
Neo 2023 年 2 月 9 日
コメント済み: Neo 2023 年 2 月 14 日
hello, I have generated a pca plot and there are obvious clusters of the data but to make it more evident I would like to draw centroids (or similar shape fitting the same purpose) around the similar data in the pca plot. Is there a way to do this in matlab? I did try John D'Errico's function: incircle(): but I don't think its quite what I am looking for. i kind of want regression centroids around the clusters of similar data.
Update: John says that won't work so to be more specific, I would like a regression line to go into 3D plot.
Thank you for your response. I have included an example of what i am looking for below.
  3 件のコメント
Neo
Neo 2023 年 2 月 10 日
That sounds like it would work!!! I do have a list of points belonging to each cluster. How would i search for the minimal circle including them? Do you have an example that i could learn from?
It would be placed into a "for loop" that says if this value matches then it will be placed here. From there the minimal circle including them will be generated. How would i do that?
Neo
Neo 2023 年 2 月 10 日
@Jan I hope you do respond because even if its not the answer I would like to know how to do this!!

サインインしてコメントする。

回答 (1 件)

John D'Errico
John D'Errico 2023 年 2 月 9 日
incircle has nothing to do with your problem. Sorry.
You would first want to use some sort of clustering algorithm on your data. k-means is the go-to tool for that.
Once you have the data clustered into groups, I would then just use the centroids from k-means itself as the center of the circles.
Alternatively, you could use my circumcircles tool to compute the circles, but the k-means centroids seem to make sense.
Finally, once you decide on the center of the circles, the radii are easy to generate as the distance to the farthest point in that cluster.
  6 件のコメント
Neo
Neo 2023 年 2 月 12 日
Dr. D’ricco can you make a kmeans plot from this example code I have made? It isn’t homework I’m practicing my skills in Matlab
Neo
Neo 2023 年 2 月 14 日
@John D'Errico I attempted kmeans and ask for your correction to make it working with min bound circle included for clusters if that makes sense thanks for your time or you can refer me to another working example I can learn from. Thanks @John D'Errico

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDimensionality Reduction and Feature Extraction についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by