\section{Random\+Partition Class Reference}
\label{classmlpack_1_1kmeans_1_1RandomPartition}\index{Random\+Partition@{Random\+Partition}}


A very simple partitioner which partitions the data randomly into the number of desired clusters.  


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ Random\+Partition} ()
\begin{DoxyCompactList}\small\item\em Empty constructor, required by the Initial\+Partition\+Policy policy. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Archive $>$ }\\void \textbf{ serialize} (Archive \&, const unsigned int)
\begin{DoxyCompactList}\small\item\em Serialize the partitioner (nothing to do). \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
{\footnotesize template$<$typename Mat\+Type $>$ }\\static void \textbf{ Cluster} (const Mat\+Type \&data, const size\+\_\+t clusters, arma\+::\+Row$<$ size\+\_\+t $>$ \&assignments)
\begin{DoxyCompactList}\small\item\em Partition the given dataset into the given number of clusters. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
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. 

Definition at line 26 of file random\+\_\+partition.\+hpp.



\subsection{Constructor \& Destructor Documentation}
\mbox{\label{classmlpack_1_1kmeans_1_1RandomPartition_ac9affc7889d9b8911bb695c6855896e1}} 
\index{mlpack\+::kmeans\+::\+Random\+Partition@{mlpack\+::kmeans\+::\+Random\+Partition}!Random\+Partition@{Random\+Partition}}
\index{Random\+Partition@{Random\+Partition}!mlpack\+::kmeans\+::\+Random\+Partition@{mlpack\+::kmeans\+::\+Random\+Partition}}
\subsubsection{Random\+Partition()}
{\footnotesize\ttfamily \textbf{ Random\+Partition} (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Empty constructor, required by the Initial\+Partition\+Policy policy. 



Definition at line 30 of file random\+\_\+partition.\+hpp.



\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1kmeans_1_1RandomPartition_a66c98fbe18c8952d61e996c723860a81}} 
\index{mlpack\+::kmeans\+::\+Random\+Partition@{mlpack\+::kmeans\+::\+Random\+Partition}!Cluster@{Cluster}}
\index{Cluster@{Cluster}!mlpack\+::kmeans\+::\+Random\+Partition@{mlpack\+::kmeans\+::\+Random\+Partition}}
\subsubsection{Cluster()}
{\footnotesize\ttfamily static void Cluster (\begin{DoxyParamCaption}\item[{const Mat\+Type \&}]{data,  }\item[{const size\+\_\+t}]{clusters,  }\item[{arma\+::\+Row$<$ size\+\_\+t $>$ \&}]{assignments }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



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).


\begin{DoxyTemplParams}{Template Parameters}
{\em Mat\+Type} & Type of data (arma\+::mat or arma\+::sp\+\_\+mat). \\
\hline
\end{DoxyTemplParams}

\begin{DoxyParams}{Parameters}
{\em data} & Dataset to partition. \\
\hline
{\em clusters} & Number of clusters to split dataset into. \\
\hline
{\em assignments} & Vector to store cluster assignments into. Values will be between 0 and (clusters -\/ 1). \\
\hline
\end{DoxyParams}


Definition at line 44 of file random\+\_\+partition.\+hpp.

\mbox{\label{classmlpack_1_1kmeans_1_1RandomPartition_aa5b3dd8336182f751ebec27167c22415}} 
\index{mlpack\+::kmeans\+::\+Random\+Partition@{mlpack\+::kmeans\+::\+Random\+Partition}!serialize@{serialize}}
\index{serialize@{serialize}!mlpack\+::kmeans\+::\+Random\+Partition@{mlpack\+::kmeans\+::\+Random\+Partition}}
\subsubsection{serialize()}
{\footnotesize\ttfamily void serialize (\begin{DoxyParamCaption}\item[{Archive \&}]{,  }\item[{const unsigned}]{int }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Serialize the partitioner (nothing to do). 



Definition at line 55 of file random\+\_\+partition.\+hpp.



The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
/var/www/mlpack.\+ratml.\+org/mlpack.\+org/\+\_\+src/mlpack-\/git/src/mlpack/methods/kmeans/\textbf{ random\+\_\+partition.\+hpp}\end{DoxyCompactItemize}
