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) & /@
RandomVariate[NormalDistribution[0, 0.5], {10^3, 2}];
c2 = {3, 3};
cluster2 = (# + c2) & /@
RandomVariate[NormalDistribution[0, 0.5], {10^3, 2}];
{clusters = Union[cluster1, cluster2],
Graphics[{{Green, Point[cluster1]}, {Red, Point[cluster2]}},
Frame -> True]}
];
graph
which looks somewhat like:
Mathematica is a powerful tool, so I tried a naive approach
cls = FindClusters[clusters];
... and got:
Further "experiments" like
FindClusters[clusters, DistanceFunction -> EuclideanDistance]
were all not successful. What worked immediately is
FindClusters[clusters, Method -> "Optimize"]
which delivers:
But the method "Optimize" is removed from documentation, see Question addressing FindClusters
So the question is: Is there an easy way to find the (obvious) clusters in that case without putting parts of the "solution" (two clusters) in the options of FindClusters?


