Questions tagged [cluster-analysis]

Questions on the cluster analysis functions of Mathematica, including the Hierarchical Clustering Package.

172 questions
18
votes
4 answers

Clustering a set of points

I have a set of 2D points in the square defined by {-1, -1} and {1, 1}. These points typically form compact groups. I need to break them into clusters in such a way that the rectangular bounding boxes of the clusters will not overlap. The…
Szabolcs
  • 234,956
  • 30
  • 623
  • 1,263
13
votes
1 answer

User-defined distance functions in FindClusters

I am trying to use FindClusters to segment data points into two special parts data ListPlot[data, PlotRange -> All, AspectRatio -> Automatic] It is clear that these points can be divided into two parts, each radial arm can be treated as one part. …
arieszp
  • 133
  • 3
13
votes
1 answer

Visualize cluster distances in DendrogramPlot

I want to perform a cluster analysis using the HierarchicalClustering package. Is there a way to display the inter-cluster distances in a dendrogram plot? An example how the result should look like: .
Frederik Ziebell
  • 1,053
  • 8
  • 21
11
votes
4 answers

data clustering

I have some data set which i would like to partition into 3 groups a:set 1 b: set 2 c: background. I use FindClusters[] function but as you can see (after evaluating the commands) the result is not what I am looking for. Can someone help? data1 =…
Doron
  • 543
  • 2
  • 13
8
votes
2 answers

Determining the Method option that FindClusters uses with AbsoluteOptions

I am trying to determine which method mathematica chooses when using FindClusters. The documentation says that it chooses the best one for the data. I have tried to use AbsoluteOptions, which says it returns the options for a command, but it does…
Mike
  • 83
  • 3
8
votes
0 answers

FindCluster only finds cluster "with a little help"

Currently I made some slides to illustrate clustering. As an example I made a point set of two clusters: {clusters, graph} = Block[{c1, c2, cluster1, cluster2}, c1 = {1, 2}; cluster1 = (# + c1) & /@ …
mgamer
  • 5,593
  • 18
  • 26
8
votes
2 answers

Why doesn't FindClusters find any clusters in this case?

I am trying to use FindClusters to segment data points into similar numbers but so far I couldn't get it work for this example: l = {110, 111, 115, 117, 251, 254, 254, 259, 399, 400, 401, 402, 542, 546, 549, 554, 660, 660, 660,…
Sven K
  • 325
  • 1
  • 9
7
votes
2 answers

How to get the centroids of the results of the ClusteringComponents function?

I use the ClusterComponent function to get the k-means clustering: Needs["HierarchicalClustering`"] cl = ClusteringComponents[data, 4, 1, DistanceFunction -> CorrelationDistance, Method -> "KMeans"]; It returns a vector of cluster labels, say:…
user13675
  • 947
  • 1
  • 6
  • 15
6
votes
1 answer

FindClusters giving wrong groupings

I am having trouble getting FindClusters to find the right clustering for this set of data (and many other sets of data similar to it): mydata= {{0.0393548, 518600.}, {0.0878788, 338.}, {0.113012, 4479.63}, {0.120947, 7030.38}, {0.121241,…
user13999
  • 907
  • 6
  • 14
6
votes
1 answer

Stopping Agglomerative clustering under a condition in Mathematica

How do I instruct Agglomerative clustering to stop/NOT merging two particular clusters if the distance between the two clusters is larger than a threshold value? I know that we can implement a custom distance measure and a custom linkage function.…
London guy
  • 453
  • 1
  • 3
  • 6
5
votes
1 answer

Clustering 3D Data Points on a Periodic Cubic Grid

I have a set of 3D data points on a cubic grid. The data can be downloaded from here https://skydrive.live.com/redir?resid=F96524B72DCD75FB!14240 and read into a variable lis using lis = ReadList["filename", {Number, Number, Number}]. How can one…
RunnyKine
  • 33,088
  • 3
  • 109
  • 176
5
votes
1 answer

FindClusters behaves strangely when an argument for number of clusters is passed

I have a question about FindClusters function. It seems that it behaves rather strangely when I pass a specific dataset to it. I am trying to use it in a bigger set of code, but I will illustrate my issue with an example. Suppose we have the…
Sisko
  • 65
  • 4
5
votes
1 answer

What's the main difference between FindClusters and ClusteringComponents?

In many cases, FindClusters and ClusteringComponents provide similar results. Options for hierarchical and agglomerative clustering are available for both of these functions. So, would you please help me to understand clearly the differences between…
Amin
  • 349
  • 2
  • 9
5
votes
0 answers

How to force FindClusters to return a specific number of clusters?

I am using FindClusters with the Method -> "KMedoids" option. I am specifying a desired number of clusters. It returns with many fewer than the desired number. Is there a way to force it to return the desired number? For reference a code snippet is …
abwatson
  • 1,919
  • 1
  • 12
  • 19
5
votes
1 answer

Divide a list of points into clusters based on the gap between them

I would like to know how I can divide the attached list of points to as many clusters as possible based on the gap between the patches. Then I can decide which one should be kept and which remove. I tried different options in Findclusters command…
Mehdi Ebadi
  • 501
  • 2
  • 7
1
2 3