title: Plot big dataset clusters in python
body: <p>So basically I'm kind of new to sklearn and ML with python in general. I'm used to RapidMiner and other GUI tools. I have this dataset with over 2 million rows and 5 columns, which are my Principal Components (around 98% variance). I executed the clustering with kmeans and obtained the labels. I already know that the number of clusters has to be 4, and initialized the algorithm using kmeans++ generated centroids.</p>
  <pre><code>from sklearn.cluster import KMeans
  preds = KMeans(n_clusters=4, init=centers_init).fit_predict(sc_norm_pca_data)
  result = np.append(sc_norm_pca_data, preds.reshape([2208556, 1]), axis=1) # append labels to data
  </code></pre>
  <p>Now I'm facing 2 problems:</p>
  <ol>
  <li><p>I don't know what's the best way to visualize the data since the
  number of components are 5. Maybe I can do a 3D plot using the
  first 3 PCs or take the labels and attach them to the pre-PCA dataset instead.</p>
  </li>
  <li><p>I tried to plot the results on a bidimensional plane using the
  first 2 PCs, but apparently using matplotlib to plot over 2mln
  points is a bad idea. So, I tried again with a sample of 10k rows
  but after 5 mins still nothing.</p>
  <pre><code>idx = np.random.randint(10, size=10000)
  result = result[idx,:]
  plt.scatter(result[:, 0], result[:, 1], c=result[:,result.shape[1]-1]) # 5th column has the labels
  </code></pre>
  </li>
  </ol>
  <p>I'd like to receive some advices on what I'm doing wrong and also how to handle these types of situations in the right way. Also, it's normal that the plot takes so long?
  I'm using Colab and did some pre-processing (cleaning, standardization, etc..) before PCA.</p>