Questions tagged [cluster-analysis]

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

Filter by
Sorted by
Tagged with
33
votes
4answers
3k 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. ...
29
votes
4answers
7k 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 ...
25
votes
4answers
2k 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 ...
17
votes
4answers
2k 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
605 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 ...
15
votes
0answers
335 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 ...
14
votes
4answers
609 views

How to split data into clusters based on fitting to function

I have data which looks somewhat like this: On the picture, you can see that the data can be described by 2 linear functions - if you manage to split it into 2 groups, each can easily be fitted with <...
13
votes
1answer
341 views

User-defined distance functions in FindClusters

I am trying to use FindClusters to segment data points into two special parts data ...
13
votes
1answer
1k 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
2answers
1k 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 ...
12
votes
1answer
592 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 ...
11
votes
4answers
2k 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
4answers
692 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: ...
9
votes
2answers
329 views

Partitioning a superset of coordinates into subsets that generate continuous curves

Consider the data set corresponding to recorded trajectories for a particle: ...
9
votes
5answers
341 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 <...
9
votes
1answer
492 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 ...
8
votes
1answer
307 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
662 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
1answer
176 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 ...
8
votes
2answers
260 views

FindClusters doesn't accept custom DistanceFunction

Bug introduced in 11.0 and fixed in 11.3 I have a problem with using custom DistanceFunction in FindClusters. To make the issue as simple as possible, consider clustering odd & even numbers in ...
7
votes
2answers
238 views

How to Wrap the Points of a 3D Clustering Plot?

I am doing clustering and have a plot as below:- ...
7
votes
2answers
138 views

Impact of Linkage and DistanceFunction on Agglomerate clustering

I'm using Agglomerate function to find clusters of my experimental points. I have about 20 points with 10 parameters each. It seems it works fine, but there are plenty of Linkage and DistanceFunction ...
7
votes
2answers
463 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
0answers
118 views

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: ...
6
votes
2answers
902 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 ...
6
votes
3answers
1k 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
148 views

How to know the layout about these points

I have such points pts=Uncompress[FromCharacterCode[ Flatten[ImageData[Import["http://i.stack.imgur.com/hkAK8.png"],"Byte"]]]]; ...
6
votes
3answers
320 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
645 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
1answer
262 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): ...
6
votes
1answer
83 views

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 ...
6
votes
2answers
1k views

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

I use the ClusterComponent function to get the k-means clustering: ...
6
votes
1answer
377 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 ...
6
votes
1answer
133 views

How do we cluster separate curves in a set of data?

Below, I have included some data. (It is long, but I don't like to host data elsewhere and provide links that might some day be broken.) Plotting this set of data,...
6
votes
0answers
82 views

Why does FindClusters put closer points into different clusters?

I am trying to do clustering and then obtained a plot as below:- ...
6
votes
0answers
58 views

What method does FindGraphCommunities use with Method -> “Centrality”?

Cross-posted to W Community I would like to know what method FindGraphCommunities uses with the option Method -> "Centrality"...
5
votes
4answers
870 views

Identifying subsets with minimal standard deviation

Consider the following: ...
5
votes
2answers
449 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
446 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
736 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 ...
5
votes
2answers
120 views

How to detect the frequency of gene pairings in lists of genetic profiles

We have a list of >1000 gene profiles each consisting typically of 4 genes. Many profiles share pairs of identical genes. Can we derive clusters of profiles which share pairs or even trios of genes? ...
5
votes
2answers
181 views

Inexplicable results from ClusteringComponents Agglomerate in version 11.1

I have data like this: data = {5, 12, 18, 19, 20, 23, 24, 26}; On Mathematica 11.1, clustering produces a variable final choice of clusters. For example: ...
5
votes
2answers
250 views

Agglomerate output to Graph

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

Why doesn't Mathematica find the obvious clusters?

I run into this problem when analyzing data with obvious clusters. Why doesn't Mathematica find the four clusters? ...
5
votes
1answer
2k 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
622 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
1answer
72 views

ClusteringComponent and FindClusters are returning the wrong number of clusters and are inconsistent

I am trying to find the optimum number of clusters in a correlation matrix. To do this I run a clustering algorithm that loops through 3 variables ( number of clusters, ...
5
votes
0answers
60 views

How to make the clustering result of version 11.2 and 11.3 same?

I was doing clustering analysis in version 11.2, with codes like below, and then got 12 clusters as the output: ...
5
votes
0answers
79 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?
5
votes
0answers
111 views

How can I change the distance function in Classify when using NearestNeighbor?

Issue not present in version "10.4.1 for Linux x86 (64-bit) (April 11, 2016)" ...