\section{Sample\+Initialization Class Reference}
\label{classmlpack_1_1kmeans_1_1SampleInitialization}\index{Sample\+Initialization@{Sample\+Initialization}}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ Sample\+Initialization} ()
\begin{DoxyCompactList}\small\item\em Empty constructor, required by the Initial\+Partition\+Policy type definition. \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\+::mat \&centroids)
\begin{DoxyCompactList}\small\item\em Initialize the centroids matrix by randomly sampling points from the data matrix. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}


Definition at line 23 of file sample\+\_\+initialization.\+hpp.



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



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



Definition at line 27 of file sample\+\_\+initialization.\+hpp.



\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1kmeans_1_1SampleInitialization_a8ee4dff98d318a0f5586140c5846ef39}} 
\index{mlpack\+::kmeans\+::\+Sample\+Initialization@{mlpack\+::kmeans\+::\+Sample\+Initialization}!Cluster@{Cluster}}
\index{Cluster@{Cluster}!mlpack\+::kmeans\+::\+Sample\+Initialization@{mlpack\+::kmeans\+::\+Sample\+Initialization}}
\subsubsection{Cluster()}
{\footnotesize\ttfamily static void Cluster (\begin{DoxyParamCaption}\item[{const Mat\+Type \&}]{data,  }\item[{const size\+\_\+t}]{clusters,  }\item[{arma\+::mat \&}]{centroids }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Initialize the centroids matrix by randomly sampling points from the data matrix. 


\begin{DoxyParams}{Parameters}
{\em data} & Dataset. \\
\hline
{\em clusters} & Number of clusters. \\
\hline
{\em centroids} & Matrix to put initial centroids into. \\
\hline
\end{DoxyParams}


Definition at line 38 of file sample\+\_\+initialization.\+hpp.



References mlpack\+::math\+::\+Rand\+Int().



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