How do I find cluster center of each cluster gained from Spectral Clustering?
5 ビュー (過去 30 日間)
古いコメントを表示
Hi, I am using Spectral Clustering for data analysis recently and I found that Spectral Clustering function built in MATLAB only returns the cluster indicator (that is, "idx"). However, I actually need the cluster center of each cluster (similar to the centroid locations gained by k-means). How can I get it? Any idea or code would be very helpful.
Regards, Ning
2 件のコメント
採用された回答
KSSV
2021 年 3 月 29 日
As you have indices in hand, you can get the centers....
clear
clc
load('xi.mat');
K=100;
[idx]=spectralcluster(xi, K);
C = zeros(k,2) ;
for i = 1:k
c = xi(idx==i) ; % this will give cluster
C(i,:) = mean(c) ; % calculate the mean
end
2 件のコメント
Megh
2022 年 8 月 2 日
I dont think it makes sense to take the mean since the mean is specifially optimized to minimize the euclidean distance from all the points in the given cluster to the cluster center, which turns out to be the mean after differentiating the MSE loss function and setting it to zero, as in k-means.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!