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

learn more… | top users | synonyms (1)

30
votes
4answers
2k views

Clustering of space-time data

Below is an example of a gaze sequence I recorded during a 3 seconds display. That is, where the eye was at every millisecond. While we should have 3000 points, we are missing some due to blinking. ...
26
votes
4answers
6k views

K-means clustering

In MATLAB, there is a command kmeans() that divides an array into $k$ clusters and calculates the centroid of each cluster. Is there any command in Mathematica to ...
23
votes
4answers
1k views

Generating an “average curve” from a dense set of “semicontinuous curves” which clear trends

This question is related to a previous one of mine: Partitioning a superset of coordinates into subsets that generate continuous curves, where the challenge was to partition a data set into two ...
16
votes
4answers
1k views

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 ...
16
votes
2answers
502 views

Cluster a signal into areas of equal intensity

Introduction I have a greyscale photograph that I want to partition into areas of equal intensity. This means, that the integral over each partition should be (roughly) equal. There is no unique ...
13
votes
1answer
877 views

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 ...
12
votes
1answer
177 views

User-defined distance functions in FindClusters

I am trying to use FindClusters to segment data points into two special parts data ...
12
votes
0answers
242 views

Strategies to find curves on messy data using FindCurvePath

I have a set of data points that correspond to roots of a transcendental equation with respect to a parameter (the abscissa) which, by the properties of the system, define continuous curves (might be ...
11
votes
4answers
1k views

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 ...
11
votes
1answer
483 views

Cluster analysis returns questionable results

A few weeks ago I ran a cluster analysis on some economic data and (unfortunately only) now I found out that some results do not make sense. For instance I analyzed the development of unemployment ...
9
votes
2answers
280 views

Partitioning a superset of coordinates into subsets that generate continuous curves

Consider the data set corresponding to recorded trajectories for a particle: ...
8
votes
2answers
445 views

Creating Identification/Classification trees

I have data given in following format; from which I need to create identification/classification trees (three different trees from three different criterion, that is average disorder, gain ratio and ...
8
votes
1answer
283 views

FindClusters for 3D Pancake/Platelet Shapes

I'm looking to properly cluster a dataset of roughly 3 million data points in 3-space. The shapes form closely spaced "clusters" that resemble pancakes. Here is a downsampled dataset: ...
8
votes
2answers
428 views

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: ...
8
votes
4answers
172 views

Cluster numbers into n partitions so that each partitions sum is closest to total/n

For example having data data = {16, 4, 17, 10, 15, 4, 4, 6, 7, 14, 9, 17, 27, 6, 1, 9, 0, 12, 20, 8, 0, 3, 4, 0, 3, 4} I want to cluster them int 4 partitions <...
7
votes
3answers
362 views

Morphological Components with periodic boundary conditions

I would like to find the connected(with periodic boundary conditions) components in a large binary matrix. What I've tried, and it does a fair job is: ...
7
votes
2answers
396 views

Different highlight for each cluster in DendrogramPlot

Is there any way to have each cluster in the DendrogramPlot highlight in a different color? I've tried the obvious way but it doesn't work: ...
7
votes
1answer
202 views

Clustered heatmaps with dendrograms

In biology it's common to cluster both dimensions of a matrix, display it as a heatmap (MatrixPlot, ArrayPlot) and show ...
6
votes
3answers
539 views

Finding connected components in an array

I have an $w\times h$ array with non-negative integers. I wish to partition the set of coordinates $(c,r)$ with $1\leq c \leq w$ and $1\leq r \leq h$, in subsets, so that each subset corresponds to a ...
6
votes
3answers
233 views

How to speed up computation of medoids?

I need to compute medoids (based on SquaredEuclideanDistance for large lists of k-vectors (k = 14). My implementations so far are impractically slow. Here is a ...
6
votes
1answer
539 views

Clustering adjacent points in 2D

I need to find all clusters of adjacent white points in a binary image. By term "adjacent" I mean that coordinates of two points differ by no more than 1 (i.e. the points ...
6
votes
2answers
285 views

How to get the centroids of the ClusterComponents function

I use the ClusterComponent function to get the k-means clustering: ...
6
votes
1answer
232 views

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 ...
5
votes
4answers
561 views

Identifying subsets with minimal standard deviation

Consider the following: ...
5
votes
2answers
423 views

Code elegance and compactness. Help needed with Map, Apply

I need some help with code optimization and compactness. I have a set of two-dimensional points and I can use the Mathematica function FindClusters to find 4 clusters. I'd like to plot the points ...
5
votes
2answers
367 views

Provided an array of 2D point clouds, can we quickly replace distance- and index-based cliques of points with their median or mean values?

Imagine I have $N \approx 10^5$ clouds of points in an array of the form: UPDATED ...
5
votes
1answer
171 views

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): ...
5
votes
1answer
102 views

How to get `FindCurvePath` to return only one list

As you can see below, FindCurvePath returns only a part of the list, resulting in a partial interpolation. I would like to interpolate all the points. Complete ...
5
votes
1answer
962 views

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 ...
5
votes
2answers
509 views

Custom distance metric for agglomerative clustering in Mathematica

Is it possible to have a custom distance metric defined to determine the distance between two clusters in Agglomerative clustering in Mathematica? I have a 3 dimension data with string values along ...
5
votes
0answers
55 views

How many clusters does DominantColors return?

Is there any documentation on how it automatically chooses the number of colors - does it use X-means or some other heuristic to determine the number of clusters it automatically returns?
4
votes
2answers
680 views

Clustering a bivariate data set with Mathematica

I need to partition a bivariate data set into predetermined "n" clusters and, at the same time, to fix the centroid position of each cluster. Is the ...
4
votes
3answers
291 views

make specific cluster

I have set of coordinates. I want to make clusters in which every point is within 1.5 distance unit of it's neighbor. ex of point coordinates: ...
4
votes
1answer
185 views

How does DistanceFunction work with images in ClusteringComponents?

Does anyone know the syntax to DistanceFunction? I am trying to define my own function to use with ClusteringComponents; e.g., <...
4
votes
1answer
157 views

Agglomerate output to Graph

I'm using the HierarchicalClustering package to cluster some data. So let's say I have this: ...
4
votes
1answer
112 views

How to automatically label the cluster distances in a DendrogramPlot?

I have a distance matrix data, and want to visualize it as below: The current codes I am using is: ...
4
votes
1answer
136 views

How to give ClusteringComponents initial values?

I came across a variant of k-means that adds a algorithm to select good starting values called k-means++. ...
3
votes
1answer
433 views

What's the main difference between FindClusters and ClusteringComponents? [closed]

In many cases, FindClusters and ClusteringComponents provide similar results. Options for hierarchical and agglomerative ...
3
votes
2answers
241 views

Which group of points connects more strongly?

I have two groups of points, and the lenth of them may be different.I want to know which group of points connects more strongly, are there any existing algorithms for this? Here are two groups of ...
3
votes
1answer
296 views

Spectral Clustering

I am attempting to implement a spectral clustering routine using Mathematica, but I am encountering difficulties. Using the standard Gaussian similarity function found in section 2.2 of this paper ...
3
votes
1answer
170 views

Setting label in DendrogramPlot

I want to create a dendrogram with the labels being a visual representation of the data. Something like this: How can I do that in Mathematica? My attempt so far hasn't been very successful. The ...
3
votes
1answer
361 views

Plotting reordered clusters with different colors and joined lines

I would like to show how typical days of energy load (found through clustering of a years worth of data) are spread throughout a year in a single graph with a color for each 'typical day' (or cluster)....
3
votes
1answer
226 views

Clustering image data by intensity and position

I'd like to apply FindClusters or ClusteringComponents to image data of an indistinct edge, with the goal of segmenting the ...
3
votes
1answer
228 views

Clustering of 2D map, based on similarity in spectra

I have experimental 2D-spectroscopy data, in a format similar to this: ...
3
votes
1answer
420 views

How to determine cluster membership using FindClusters?

I have a 1000 by 3 data matrix in which for each person we have 3 scores. I want to cluster those persons into 8 cluster using Agglomerative method. I did the clusetring by: ...
3
votes
0answers
49 views

Clustering with restrictions

I have this dataset of a ranking of roughly 32.5k players in increasing order. The third column contains the number of players which have the corresponding score, whilst the second is the number ...
3
votes
0answers
85 views

k-means clustering in parallel

How can the k-means algorithm for some given distance function be implemented using ParallelMap or other parallel processing program constructs in Mathematica?
2
votes
3answers
466 views

Clustering data sets with multiple variables

I am learning how to cluster large datasets and this maybe a newbie question, but I haven’t found a suitable answer in the Documentation or on this board. My question is best illustrated by an ...
2
votes
1answer
270 views

Hierarchical clustering: convert Mathematica cluster hierarchy to NEWICK format

Can anyone tell me a clever way to convert the hierarchical clustering object, created, say, by Agglomerate or DirectAgglomerate ...
2
votes
1answer
322 views

Cluster entities by a combination of values

I can plot the population of zip codes in NY with something like ...