instead of adjusted_rand_scorenormalized_mutual_info_scoreor some other clustering metric the problem in using accuracy is that it requires the assigned cluster labels to exactly match the ground truth howeverthe cluster labels themselves are meaningless--the only thing that matters is which points are in the same clusterin[ ]from sklearn metrics import accuracy_score these two labelings of points correspond to the same clustering clusters [ clusters [ accuracy is zeroas none of the labels are the same print("accuracy{ }format(accuracy_score(clusters clusters ))adjusted rand score is as the clustering is exactly the same print("ari{ }format(adjusted_rand_score(clusters clusters ))out[ ]accuracy ari evaluating clustering without ground truth although we have just shown one way to evaluate clustering algorithmsin practicethere is big problem with using measures like ari when applying clustering algorithmsthere is usually no ground truth to which to compare the results if we knew the right clustering of the datawe could use this information to build supervised model like classifier thereforeusing metrics like ari and nmi usually only helps in developing algorithmsnot in assessing success in an application there are scoring metrics for clustering that don' require ground truthlike the silhouette coefficient howeverthese often don' work well in practice the silhouette score computes the compactness of clusterwhere higher is betterwith perfect score of while compact clusters are goodcompactness doesn' allow for complex shapes here is an example comparing the outcome of -meansagglomerative clusteringand dbscan on the two-moons dataset using the silhouette score (figure - )in[ ]from sklearn metrics cluster import silhouette_score xy make_moons(n_samples= noise= random_state= rescale the data to zero mean and unit variance scaler standardscaler(scaler fit(xx_scaled scaler transform(xclustering