\begin{figure}
\begin{alltt}
function K-Means(data)
  Centroids = A random subset of K instances from data
  
  for each row in data
    m(row) = the cluster closest to row
    
  while m has changed
    for each centroid in Centroids
      centroid = the centroid of the current instances assigned to that centroid
      
    for each row in data
      m(row) = the cluster closes to row
  
  return Centroids
\end{alltt}
\caption{Pseudo code of K-Means\cite{Kadous02temporalclassification}}\label{fig:pseudoCode-kmeans}
\end{figure}
