|
| | 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. More...
|
| |
| 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. More...
|
| |
| double | EstimateRadius (const MatType &data, const double ratio=0.2) |
| | Give an estimation of radius based on given dataset. More...
|
| |
| const KernelType & | Kernel () const |
| | Get the kernel. More...
|
| |
| KernelType & | Kernel () |
| | Modify the kernel. More...
|
| |
| size_t | MaxIterations () const |
| | Get the maximum number of iterations. More...
|
| |
| size_t & | MaxIterations () |
| | Set the maximum number of iterations. More...
|
| |
| double | Radius () const |
| | Get the radius. More...
|
| |
| void | Radius (double radius) |
| | Set the radius. More...
|
| |
template<bool UseKernel = false, typename KernelType = kernel::GaussianKernel, typename MatType = arma::mat>
class mlpack::meanshift::MeanShift< UseKernel, KernelType, MatType >
This class implements mean shift clustering.
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.
* extern arma::mat data;
* arma::Row<size_t> assignments;
* arma::mat centroids;
* bool forceConvergence = true;
* to converge regardless of maxIterations.
*
* MeanShift<> meanShift();
* meanShift.Cluster(dataset, assignments, centroids, forceConvergence);
*
- Template Parameters
-
| UseKernel | Use kernel or mean to calculate new centroid. If false, KernelType will be ignored. |
| KernelType | The kernel to use. |
| MatType | The type of matrix the data is stored in. |
Definition at line 51 of file mean_shift.hpp.