|
mlpack
|
A very simple partitioner which partitions the data randomly into the number of desired clusters. More...
#include <random_partition.hpp>
Public Member Functions | |
| RandomPartition () | |
| Empty constructor, required by the InitialPartitionPolicy policy. | |
| template<typename Archive > | |
| void | serialize (Archive &, const uint32_t) |
| Serialize the partitioner (nothing to do). | |
Static Public Member Functions | |
| template<typename MatType > | |
| static void | Cluster (const MatType &data, const size_t clusters, arma::Row< size_t > &assignments) |
| Partition the given dataset into the given number of clusters. More... | |
A very simple partitioner which partitions the data randomly into the number of desired clusters.
It has no parameters, and so an instance of the class is not even necessary.
|
inlinestatic |
Partition the given dataset into the given number of clusters.
Assignments are random, and the number of points in each cluster should be equal (or approximately equal).
| MatType | Type of data (arma::mat or arma::sp_mat). |
| data | Dataset to partition. |
| clusters | Number of clusters to split dataset into. |
| assignments | Vector to store cluster assignments into. Values will be between 0 and (clusters - 1). |
1.8.13