<p>In <a href="https://github.com/mlpack/mlpack/pull/388#discussion_r23608241">src/mlpack/methods/mean_shift/mean_shift.hpp</a>:</p>
<pre style='color:#555'>&gt; + * For each point in dataset, apply mean shift algorithm until maximum 
&gt; + * iterations or convergence. 
&gt; + * Then remove duplicate centroids.
&gt; + * 
&gt; + * A simple example of how to run Mean Shift clustering is shown below.
&gt; + *
&gt; + * @code
&gt; + * extern arma::mat data; // Dataset we want to run Mean Shift on.
&gt; + * arma::Col&lt;size_t&gt; assignments; // Cluster assignments.
&gt; + * arma::mat centroids; // Cluster centroids.
&gt; + *
&gt; + * MeanShift&lt;arma::mat, kernel::GaussianKernel&gt; meanShift();
&gt; + * meanShift.Cluster(dataset, assignments, centroids);
&gt; + * @endcode
&gt; + *
&gt; + * @tparam KernelType the kernel to use.
</pre>
<p>I thought about this a little more, and there's actually no need for type traits.  Translation invariant kernels can simply provide <code>double Evaluate(const double distance)</code>, so you might use this in the wild like:</p>

<pre><code>// assume we have 'metric' and 'kernel'
const double k = kernel.Evaluate(metric.Evaluate(dataset.col(i), dataset.col(j)));
</code></pre>

<p>This also forces a radial basis kernel of some sort, so there's no need to worry about re-deriving mean shift for the non-radial kernel case.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/mlpack/mlpack/pull/388/files#r23608241">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFGRsnLK7Rw1rDLZ6ldrYn3cmh6fcks5nl48AgaJpZM4DTzb1.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
  <div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
    <link itemprop="url" href="https://github.com/mlpack/mlpack/pull/388/files#r23608241"></link>
    <meta itemprop="name" content="View Pull Request"></meta>
  </div>
  <meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>