I am trying to test how well my unsupervised K-Means clustering properly clusters my data.  I have an unsupervised K-Means clustering model output (as shown in the first photo below) and then I clustered my data using the actual classifications.The photo below are the actual classifications.  I am trying to test, in Python, how well my K-Means classification (above) did against the actual classification.For my K-Means code, I am using a simple model, as follows:kmeans = KMeans(n_clusters=4, random_state=0).fit(myData)labels = kmeans.labels_What would be the best way for me to compare how well my unsupervised KMeans clustering model did against the actual classifications?
How to test accuracy of an unsupervised clustering model output?
clustering;k means
Since you have the actual labels, you can compare them with the obtained labels and evaluate performance. Typically purity and nmi (normalized mutual information) are used. Read this (Evaluation of Clustering) document for detailed explanation.If you don't have actual labels then you can use modularity or [Silhouette] for measuring clustering performance.