MATLAB Answers

The count of output clusters

3 views (last 30 days)
Silpa K
Silpa K on 30 Jan 2020
Edited: Cris LaPierre on 2 Feb 2020
clc;
clear;
data=xlsread('Pimaxl.xlsx');
minpts=4;
epsilon=2;
tic
idx=dbscan(asc,epsilon,minpts);
eucD = pdist(idx,'euclidean');
Z = linkage(eucD,'average');
toc
How can I show the number of output clusters of dbscan and linkage? Please help me.

  0 Comments

Sign in to comment.

Accepted Answer

Cris LaPierre
Cris LaPierre on 30 Jan 2020
Edited: Cris LaPierre on 2 Feb 2020
I would think max(idx) should tell you the number of clusters dbscan found.
For linkage, I think this is easiest if you use the cluster function. This example comes from the documentation.
X = rand(20000,3);
Z = linkage(X,'ward');
c = cluster(Z,'Maxclust',4);
scatter3(X(:,1),X(:,2),X(:,3),10,c)
Therefore, max(c) should tell you the number of clusters.

  0 Comments

Sign in to comment.

More Answers (0)

Sign in to answer this question.


Translated by