13#ifndef MLPACK_METHODS_MEAN_SHIFT_MEAN_SHIFT_HPP
14#define MLPACK_METHODS_MEAN_SHIFT_MEAN_SHIFT_HPP
20#include <boost/utility.hpp>
48template<
bool UseKernel =
false,
50 typename MatType = arma::mat>
66 const size_t maxIterations = 1000,
67 const KernelType kernel = KernelType());
90 arma::Row<size_t>& assignments,
92 bool forceConvergence =
true,
93 bool useSeeds =
true);
106 const KernelType&
Kernel()
const {
return kernel; }
124 void GenSeeds(
const MatType& data,
125 const double binSize,
137 template<
bool ApplyKernel = UseKernel>
138 typename std::enable_if<ApplyKernel, bool>::type
139 CalculateCentroid(
const MatType& data,
140 const std::vector<size_t>& neighbors,
141 const std::vector<double>& distances,
142 arma::colvec& centroid);
152 template<
bool ApplyKernel = UseKernel>
153 typename std::enable_if<!ApplyKernel, bool>::type
154 CalculateCentroid(
const MatType& data,
155 const std::vector<size_t>& neighbors,
156 const std::vector<double>&,
157 arma::colvec& centroid);
167 size_t maxIterations;
177#include "mean_shift_impl.hpp"
The standard Gaussian kernel.
This class implements mean shift clustering.
double Radius() const
Get the radius.
double EstimateRadius(const MatType &data, const double ratio=0.2)
Give an estimation of radius based on given dataset.
KernelType & Kernel()
Modify the kernel.
MeanShift(const double radius=0, const size_t maxIterations=1000, const KernelType kernel=KernelType())
Create a mean shift object and set the parameters which mean shift will be run with.
size_t MaxIterations() const
Get the maximum number of iterations.
size_t & MaxIterations()
Set the maximum number of iterations.
const KernelType & Kernel() const
Get the kernel.
void Radius(double radius)
Set the radius.
void Cluster(const MatType &data, arma::Row< size_t > &assignments, arma::mat ¢roids, bool forceConvergence=true, bool useSeeds=true)
Perform mean shift clustering on the data, returning a list of cluster assignments and centroids.
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.