Using different distances with evalclusters
9 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Manash Sahoo
le 5 Mai 2021
Réponse apportée : Shraddha Jain
le 22 Juin 2021
Hey everyone!
I would like to use the evalclusters function with linkage method. However, the doc for the function states that specifying 'linkage' in input in evalclusters will use agglorometive clustering with ward's distance. However, I would like to use complete distance as opposed to ward's. I've tried this to no avail:
f = @(X)linkage(X,'complete');
eva = evalclusters(Data,f,'klist',[1:6]);
All this does is return an empty Evaluation object with NaNs as the outputs.
How would I go about specifying distance in these functions?
Any help would be great. Thanks!
0 commentaires
Réponse acceptée
Shraddha Jain
le 22 Juin 2021
Hi Manash,
The second input argument clust in the function evalclusters refers to the clustering algorithm that is used.
When clust is specified as 'linkage', it means that clusterdata agglomerative clustering algorithm will be used to cluster the given input data x with the algorithm for computing the distance between clusters'Linkage' pre-defined to 'ward'.
This 'Linkage'algorithm could certainly be changed to something other than 'ward' by speifying it in a function handle using clusterdata and passing that as the clust argument in evalclusters,
f = @(x,k) clusterdata(x,'linkage','complete','maxclust',k);
eva = evalclusters(Data,f,'klist',[1:6]);
The reason that Ward Linkage is used as default in clusterdata as it the minimum variance method, therefore it minimizes the total within-cluster variance.
Hope this helps!
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Cluster Visualization and Evaluation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!