<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'>> + * For each point in dataset, apply mean shift algorithm until maximum
> + * iterations or convergence.
> + * Then remove duplicate centroids.
> + *
> + * A simple example of how to run Mean Shift clustering is shown below.
> + *
> + * @code
> + * extern arma::mat data; // Dataset we want to run Mean Shift on.
> + * arma::Col<size_t> assignments; // Cluster assignments.
> + * arma::mat centroids; // Cluster centroids.
> + *
> + * MeanShift<arma::mat, kernel::GaussianKernel> meanShift();
> + * meanShift.Cluster(dataset, assignments, centroids);
> + * @endcode
> + *
> + * @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;">—<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>