4
$\begingroup$

I would like to specify the radius used for the "MeanShift" Method of FindClusters. Where in the documentation can this information be found?

For a minimal example.

SeedRandom[123];
dis = MixtureDistribution[{1, 1, 1, 1}, {
    MultinormalDistribution[{-1, -3}, {{.5, 0}, {0, .5}}],
    MultinormalDistribution[{-3, 1}, {{.5, 0}, {0, .5}}],
    MultinormalDistribution[{1, 4}, {{.5, 0}, {0, .5}}], 
    MultinormalDistribution[{0, 0}, {{.5, 0}, {0, .5}}]}];
data = RandomVariate[dis, 500];
ListPlot[data, PlotRange -> All]

Mathematica graphics

ListPlot[FindClusters[data, Method -> "MeanShift"]]

Mathematica graphics

I want to tweak the radius such that it returns 4 clusters. I know I can use the "KMeans" method with a target of 4 clusters but I can't pre-select the clusters in all instances.

$\endgroup$
3
$\begingroup$
ListPlot[clusters = 
  FindClusters[data, 
   Method -> {"MeanShift", "NeighborhoodRadius" -> 0.5}]]

enter image description here

Length @ clusters

4

$\endgroup$
  • $\begingroup$ I saw "NeighborhoodRadius" as an additional option for "NeighborhoodContraction". Did you just try and see or is there somewhere in the documentation that further options are given for Method options? $\endgroup$ – Edmund Feb 6 '18 at 20:08
  • $\begingroup$ I saw it exactly there, and just tried it and it appears to work. $\endgroup$ – corey979 Feb 6 '18 at 20:12
  • $\begingroup$ Documentation needs some work on this function. $\endgroup$ – Edmund Feb 6 '18 at 21:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.