Clustering with dbscan in 3d

14 Ansichten (letzte 30 Tage)
jeffs
jeffs am 6 Jun. 2017
Kommentiert: jeffs am 7 Jun. 2017
hello community
i am trying to cluster a 3d binary matrix (size: 150x131x134) because there are separeted groups of data structure. i used kmeans(X) before and in some cases there is a good output, but only for data sets which contain less than 4 cluster structures. my matrix will contain up to 8 separate data structures and the kmeans is unefficient then because there is a high dependence on inital conditions in some cases it cuts a data structure in half. now i found another cluster algorithm: dbscan; but i couldnt find any implementation which works in 3d in matlab too.
any idea where i can get a good dbscan algorithm implementation in matlab?
  5 Kommentare
jeffs
jeffs am 6 Jun. 2017
data typ is: 154x135x131 logical
>> version
ans =
9.1.0.441655 (R2016b)
jeffs
jeffs am 6 Jun. 2017
by turning it from logical to single i get following error:
>> [IDX, isnoise]=dbscanKopie(versuch,0.5,10)
Error using pdist2 (line 136) N-D arrays are not supported.
Error in dbscanKopie (line 21) D=pdist2(X,X);
it seems like there is some problem in pdist2()..

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Walter Roberson
Walter Roberson am 6 Jun. 2017
You need to convert your data to vector or to 2D with one "point" per row. The "distance" measure used expects each row to be a separate sample, and is not able to find distances for 3D.
  3 Kommentare
Walter Roberson
Walter Roberson am 6 Jun. 2017
You have not really indicated what you want to cluster on. Each of your values is either 0 or 1, so if you cluster on the value you would be obtaining at most two clusters. Are you looking for rows that have some relationship, or columns that have some relationship, or pages that have some relationship?
My suspicion is that you should be considering bwconncomp to find the parts that are contiguous.
jeffs
jeffs am 7 Jun. 2017
CC =
Connectivity: 26
ImageSize: [154 135 131]
NumObjects: 5
PixelIdxList: {1x5 cell}
>> CC.PixelIdxList
ans =
Columns 1 through 3
[1936x1 double] [1210x1 double] [3264x1 double]
Columns 4 through 5
[1664x1 double] [1394x1 double]
after bwconncom() i get this result. with the kmeans algorithm i got the same cluster structure with same size of each structure. is bwconncom() also working when i have a data set where two clusters can overlap? now there is a set of cell arrays containing the linear indices of the pixels in the kth object. but how to implement this in dbscan?

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Statistics and Machine Learning Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by