how to change fuzzy sub cluster code to kmeans

4 vues (au cours des 30 derniers jours)
Maria Natalia
Maria Natalia le 18 Déc 2020
Réponse apportée : Anay le 19 Fév 2025
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');

Réponses (1)

Anay
Anay le 19 Fév 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!

Catégories

En savoir plus sur Statistics and Machine Learning Toolbox dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by