TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Introduction to Mean Shift Algorithm

120 pointsby DLionover 8 years ago

12 comments

rcthompsonover 8 years ago
For all those struggling to understand the mean shift algorithm, it&#x27;s much easier to understand in pictures. Here&#x27;s an article that explains it with some diagrams: <a href="http:&#x2F;&#x2F;eric-yuan.me&#x2F;continuously-adaptive-shift&#x2F;" rel="nofollow">http:&#x2F;&#x2F;eric-yuan.me&#x2F;continuously-adaptive-shift&#x2F;</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 &amp; 4 until convergence. Each iteration will move &quot;uphill&quot; 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 &quot;circle&quot; with sphere (3-D) or hypersphere (4 &amp; higher dimensions). Obviously, this algorithm depends on a choice of radius, which determines the granularity of the search for local maxima.
评论 #12416650 未加载
评论 #12415155 未加载
评论 #12415156 未加载
koughover 8 years ago
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:&#x2F;&#x2F;scikit-learn.org&#x2F;stable&#x2F;auto_examples&#x2F;cluster&#x2F;plot_cluster_comparison.html#example-cluster-plot-cluster-comparison-py" rel="nofollow">http:&#x2F;&#x2F;scikit-learn.org&#x2F;stable&#x2F;auto_examples&#x2F;cluster&#x2F;plot_cl...</a>
评论 #12414847 未加载
web007over 8 years ago
This sounds similar to k-means - pick some points &quot;at random&quot; 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?
评论 #12413966 未加载
nojvekover 8 years ago
I was expecting a more intro-ey layman explanation. This was pretty hard to understand.
评论 #12413437 未加载
m_y-n_a_m_eover 8 years ago
Mean Shift in R <a href="https:&#x2F;&#x2F;cran.r-project.org&#x2F;web&#x2F;packages&#x2F;MeanShift&#x2F;MeanShift.pdf" rel="nofollow">https:&#x2F;&#x2F;cran.r-project.org&#x2F;web&#x2F;packages&#x2F;MeanShift&#x2F;MeanShift....</a>
thecourierover 8 years ago
I love this blog. whenever I want to learn something cool I open Chrome in my Android and type: saravananthirumuruganathan.wordpress.com
brianbernsover 8 years ago
&gt; 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.
评论 #12414011 未加载
评论 #12413643 未加载
biomcgaryover 8 years ago
I just got out of a genome talk that uses the Mean Shift algorithm to find gene clusters, which speaks to the broad applicability of the algorithm.
garbage_stainover 8 years ago
mlpack has a nice command-line-accessible implementation: <a href="http:&#x2F;&#x2F;mlpack.org&#x2F;docs&#x2F;mlpack-2.0.3&#x2F;man&#x2F;mlpack_mean_shift.html" rel="nofollow">http:&#x2F;&#x2F;mlpack.org&#x2F;docs&#x2F;mlpack-2.0.3&#x2F;man&#x2F;mlpack_mean_shift.ht...</a>
nerdponxover 8 years ago
This sounds an awful lot like Expectation-Maximization
评论 #12417273 未加载
tmalyover 8 years ago
this algorithm looks interesting.<p>any chance you could move it to github?
评论 #12412477 未加载
评论 #12415372 未加载
sixhobbitsover 8 years ago
(2010)