how to change fuzzy sub cluster code to kmeans
Mostrar comentarios más antiguos
A=xlsread('APNORM.xlsx',5,'J12:M41');
B=xlsread('APNORM.xlsx',5,'P12:S41');
C=[A;B];
[Co,S,L] = pca(C);
S=S(:,1:2);
[C,b] = subclust(S,0.9);
scatter(S(1:30,1),S(1:30,2),'ob');
hold on
scatter(S(31:60,1),S(31:60,2),'or');
scatter(C(:,1),C(:,2),'dm');
xlabel('PC1');
ylabel('PC2');
legend('Normal','Hipoksemia','Titik Tengah Klaster');
Respuestas (1)
Anay
el 19 de Feb. de 2025
Hi Maria,
I understand that you are trying to use k-means clustering instead of subtractive clustering. To achieve this, you can use the “kmeans” function instead of the “subclust” function to use k-means algorithm for clustering.
Note that you need to specify number of clusters as input to the “kmeans” function.
You can refer to the documentation of the “kmeans” function by using the following command in the Command Window of MATLAB:
>>doc kmeans
Hope this helps!
Categorías
Más información sobre Statistics and Machine Learning Toolbox en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!