I started tinkering with sklearn kmeans last night out of curiosity with the goal of clustering users into groups to see what kind of user groups I can derive.  I am lost when it comes to plotting the results as most examples have nice (x,y) coordinates.  For example, the iris data set has pedal width and pedal length.  From my experimentation, I don't seem to have anything that displays very nice.  Is this assumption correct / does anyone have tips, pointers, learning resources that they could offer?import pandas as pdimport pprintimport numpy as npfrom sklearn.preprocessing import normalizefrom sklearn.preprocessing import LabelEncoderfrom sklearn.cluster import KMeansfrom collections import defaultdictimport matplotlib.pyplot as pltfrom matplotlib import stylestyle.use('ggplot')I normalized the data as it had a wide variance...again, not sure if this is a correct assumption to makeX = np.array(normalize(data, axis=0, copy=False))kmeans = KMeans(n_clusters=3)pred = kmeans.fit_predict(X)labels = kmeans.labels_cent = kmeans.cluster_centers_plt.scatter(X[:, [4]], X[:, [6]])plt.scatter(cent[:, [4]], cent[:, [6]], marker=x, s=150, linewidths=5, zorder=10)plt.ylabel('Count')plt.xlabel('Department')plt.show()Any pointers are appreciated, I will include sample data below.  Thanks!Sample Data:emp_type,title,work_country,director_userid,dept_name,business_unit_name,UserCNT0,9,7,29,20,2,20,13,7,8,14,6,50,4,3,56,29,8,30,15,3,36,32,2,30,4,3,32,16,2,00,4,1,40,13,6,00,4,3,62,12,4,10,13,7,61,5,13,42,1,3,70,35,15,20,4,3,64,4,13,02,1,3,43,43,2,00,13,7,50,17,16,02,1,3,31,26,2,12,1,3,65,58,17,00,4,3,57,63,12,02,1,6,7,45,18,22,1,3,43,42,2,01,1,7,65,58,17,02,1,3,32,16,2,02,1,3,29,20,2,00,4,0,50,17,16,20,5,3,20,23,9,00,9,3,32,16,2,20,4,3,5,51,12,02,1,7,51,53,7,00,13,7,37,55,12,02,1,4,19,62,13,0Example clustering using entire data set:
Quick start using python and sklearn kmeans?
python;scikit learn;k means
This has been answered in other places e.g. here.You could run Principal Component Analysis (or other dimensionality reduction techniques) and plot the cluster for the first two principal components. You could plot the results for two variables at a time.You could encode third or fourth variables using standard visualization techniques like color coding, symbols or facetting. There are ways to visualize the quality of the fit e.g. silhouette analysis or elbow test for determining the number of cluster etc.Have a quick look at this link