I am trying to evaluate clustering performance. I was reading the skiscit-learn documentation on metrics. I do not understand the difference between ARI and AMI. It seems to me that they do the same thing in two different ways.

Citing from the documentation:

Given the knowledge of the ground truth class assignments labels_true and our clustering algorithm assignments of the same samples labels_pred, the adjusted Rand index is a function that measures the similarity of the two assignments, ignoring permutations and with chance normalization.

vs

Given the knowledge of the ground truth class assignments labels_true and our clustering algorithm assignments of the same samples labels_pred, the Mutual Information is a function that measures the agreement of the two assignments, ignoring permutations ... AMI was proposed more recently and is normalized against chance.

Should I use both of them in my clustering evaluation or would this be redundant?

• Mr. Rand is not random. Feb 7, 2017 at 20:30

They are two out of a dozen that all try to compare clusterings.

But they are not equivalent. They use different theory.

Sometimes, ARI may prefer one result and the AMI another. But often they agree in preference (not in the numbers).

• What do you mean with: " they agree in preference (not in the numbers)? " Feb 8, 2017 at 7:35
• When you compare multiple results. Feb 8, 2017 at 20:36
• @al27091: Has QUIT--Anony-Mousse means that when you compare partitions of a set of algorithms' with a reference partition using both ARI and AMI, then most likely both ARI and AMI will rank the algorithms' result in the same way. However, the numbers of ARI and AMI will be different. Jun 8, 2021 at 15:50

• Use ARI when the ground truth clustering has large equal sized clusters
• Use AMI when the ground truth clustering is unbalanced and there exist small clusters

I worked on this topic. Reference: Adjusting for Chance Clustering Comparison Measures

A one-line summary of the paper is: AMI is high when there are pure clusters in the clustering solution.

Let's have a look at an example. We have a reference clustering V consisting of 4 equal size clusters. Each cluster is of size 25. Then we have two clustering solutions:

• U1 that has pure clusters (many zeros in the contingency table)
• U2 that has impure clusters

AMI will choose U1 and ARI will choose U2.

Eventually:

• U1 is unbalanced. Unbalanced clusters have more chances to present pure clusters. AMI is biased towards unbalanced clustering solutions
• U2 is balanced. ARI is biased towards balanced clustering solutions.

If we are using external validity indices such as AMI and ARI, we are aiming at matching the reference clustering with our clustering solution. This is why the recommendation at the top: AMI when the reference clustering is unbalanced, and ARI when the reference clustering is balanced. We do this mainly due to the biases in both measures.

Also, when we have an unbalanced reference clustering with small clusters, we are even more interested in generating pure small clusters in the solution. We want to identify precisely the small clusters from the reference. Even a single mismatched data point can have a relatively higher impact.

Other than the recommendations above, we could use AMI when we are interested in having pure clusters in the solution.

## Experiment

Here I sketched an experiment where P generates solutions U which are balanced when P=1 and unbalanced when P=0. You can play with the notebook here.

• pastebin.com/raw/WHvTxbLm This is one of the cases that I do not understand: Better AMI does not mean better ARI and vice-versa. Is there any reason why I would trust the relative improvement of one or the other. I am not sure which metric to look at in order to improve my results (from the paper you linked, I sense it should be AMI given my class distribution but I am still confused). Nov 15, 2018 at 12:39
• In you case, HDBSCAN result shows a very big cluster and many small ones which is by definition an unbalanced solution. Hence AMI is bigger with DBSCAN. Your ground truth is more balanced than that solution. Therefore, I would use ARI to choose the solution here. This said, it seems that the clustering solutions you obtained are not that good. Maybe it is because you have many clusters. Could you reduce the number of clusters that you want? Or do you have features to take into account rather than using a purely distance based clustering? Nov 15, 2018 at 15:24
• After more qualitative testing, it turns out that AMI was more reliable for my use case. Indeed, AMI said that the HDBSCAN was better, and I found it better indeed. Although I had one big noise cluster, the other clusters were purer than the KMEANS clusters. Nov 30, 2018 at 10:48
• Neither ARI nor AMI understands noise or hierarchies. You should not use them on a hierarchical clustering result with noise. Mar 17 at 17:02
• There are some density-based measures that might be more suitable. But they key question is: what measure is relevant for your problem. There is no use in measuring "quality" with a measure that measures the wrong thing for you. But is there any use for label based evaluation besides ivory tower paper-writing? Mar 27 at 12:04