For all those struggling to understand the mean shift algorithm, it's much easier to understand in pictures. Here's an article that explains it with some diagrams: <a href="http://eric-yuan.me/continuously-adaptive-shift/" rel="nofollow">http://eric-yuan.me/continuously-adaptive-shift/</a><p>Basically, it goes like this:<p>1. Select a data point of interest.<p>2. Draw a circle of a specified radius around the point of interest.<p>3. Collect all data points within the circle and compute their mean.<p>4. Move the center of the circle to the mean.<p>5. Repeat 3 & 4 until convergence. Each iteration will move
"uphill" on the density gradient of the data distribution until it reaches the top of the hill (a local maximum).<p>6. Repeat 1-5 for all data points. Points that converge to the same local maximum are members of the same cluster. The number of clusters is the number of local maxima.<p>For higher dimensions, replace "circle" with sphere (3-D) or hypersphere (4 & higher dimensions). Obviously, this algorithm depends on a choice of radius, which determines the granularity of the search for local maxima.
Cool writeup. This is part of sklearn, which has a great visualization of how it performs on some different clustering tasks, including comparisons to other algorithms: <a href="http://scikit-learn.org/stable/auto_examples/cluster/plot_cluster_comparison.html#example-cluster-plot-cluster-comparison-py" rel="nofollow">http://scikit-learn.org/stable/auto_examples/cluster/plot_cl...</a>
This sounds similar to k-means - pick some points "at random" and iteratively move them to the average location of all nearest neighbors until you stabilize. But mean shift goes in the opposite direction, giving each point a window and grouping them on overlaps. Can someone who understands both confirm this is the case, or correct my understanding?
Mean Shift in R <a href="https://cran.r-project.org/web/packages/MeanShift/MeanShift.pdf" rel="nofollow">https://cran.r-project.org/web/packages/MeanShift/MeanShift....</a>
> For each data point, Mean shift defines a window around it and computes the mean of the data point.<p>This makes no sense. A clearer explanation would go a long way.
mlpack has a nice command-line-accessible implementation: <a href="http://mlpack.org/docs/mlpack-2.0.3/man/mlpack_mean_shift.html" rel="nofollow">http://mlpack.org/docs/mlpack-2.0.3/man/mlpack_mean_shift.ht...</a>