I want to make 4 clusters using k mean clustering and for each of the 4 clusters i want to set centroid initially and then accordingly make the cluster. how can I.

2 ビュー (過去 30 日間)
X3=[-6.189; -3.251; 2.926; 6.534; 10.79; 5.203; -4.465; 1.42; -8.66; -0.8748; 6.534 ; 11.251] ;
Y3=[ 1.393; 10.42; 6.639; 5.821; 8.425; 2.924; 1.139; 0.7508; -7.917; -6.928; -10.01; -7.03; 5.639];
X3 and Y3 are my corrdinates of data.
I want 4 clusters whose centroid would be (x_b,y_b)
x_b=[0.7298; 3; -5.23; 11.86];
y_b=[12.48; -1.497; -6.139; -3.23];
how can i do this..?

採用された回答

KSSV
KSSV 2022 年 3 月 29 日
X3=[-6.189; -3.251; 2.926; 6.534; 10.79; 5.203; -4.465; 1.42; -8.66; -0.8748; 6.534 ; 11.251] ;
Y3=[ 1.393; 10.42; 6.639; 5.821; 8.425; 2.924; 1.139; 0.7508; -7.917; -6.928; -10.01; -7.03; ];
x_b=[0.7298; 3; -5.23; 11.86];
y_b=[12.48; -1.497; -6.139; -3.23];
P = [X3 Y3] ; % points
G = 4 ; % number of groups
C = [x_b y_b] ; % centroids
idx = kmeans(P,G,'MaxIter',10,'Start',C);
gscatter(P(:,1),P(:,2),idx)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCluster Analysis and Anomaly Detection についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by