title: K-means clustering using sklearn.cluster
body: <p>I came across this tutorial on K-means clustering on <a href="https://pythonprogramming.net/flat-clustering-machine-learning-python-scikit-learn/" rel="nofollow">Unsupervised Machine Learning: Flat Clustering</a>, and below is the code:</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  from matplotlib import style
  style.use("ggplot")
  
  from sklearn.cluster import KMeans
  
  X = np.array([[1,2],[5,8],[1.5,1.8],[1,0.6],[9,11]])
  
  kmeans = KMeans(n_clusters=3)
  kmeans.fit(X)
  
  centroid = kmeans.cluster_centers_
  labels = kmeans.labels_
  
  print (centroid)
  print(labels)
  
  colors = ["g.","r.","c."]
  
  for i in range(len(X)):
     print ("coordinate:" , X[i], "label:", labels[i])
     plt.plot(X[i][0],X[i][1],colors[labels[i]],markersize=10)
  
  plt.scatter(centroid[:,0],centroid[:,1], marker = "x", s=150, linewidths = 5, zorder =10)
  
  plt.show()
  </code></pre>
  
  <p>In this example, the array has only 2 features <code>[1,2],[5,8],[1.5,1.8]</code> etc.</p>
  
  <p>I have tried to replace the <code>X</code> with 10 x 750 matrix (750 features) stored in an <code>np.array()</code>. 
  The graph it created just does not make any sense.</p>
  
  <p>How could I alter the above code to solve my problem?</p>