title: get cluster labels in mllib kmeans pyspark
body: <p>How do I get cluster labels when I use Spark's mllib in pyspark? In sklearn, this can be done easily by </p>
  
  <pre><code>kmeans = MiniBatchKMeans(n_clusters=k,random_state=1)
  temp=kmeans.fit(data)
  cluster_labels=temp.labels_
  </code></pre>
  
  <p>In mllib, I run kmeans as :</p>
  
  <pre><code>temp = KMeans.train(data, k, maxIterations=10, runs=10, initializationMode="random")
  </code></pre>
  
  <p>This returns a <code>KmeansModel</code> object. This class doesn't have any equivalent of sklearn's <code>labels_</code></p>
  
  <p>I am unable to figure to out how to get the labels in mllib's kmeans</p>