Rand Index Calculator

Analyze two clusterings with detailed pairwise similarity outputs. Inspect counts, matrices, agreement rates, and exports. Use clean visuals for faster validation across clustering studies.

Calculator Input
Use commas, semicolons, vertical bars, or new lines.
Each entry is the cluster label for one item.
This list must contain the same item count as Partition A.
Example Data Table
Item Partition A Partition B
A1X
B1X
C1Y
D2Y
E2Y
F3Z
G3Z
H3Z

This sample shows how two clustering solutions can agree on some pairs and disagree on others.

Formula Used

The Rand Index measures how similarly two partitions classify all possible item pairs.

  • a = number of pairs placed in the same cluster by both partitions.
  • b = number of pairs placed in different clusters by both partitions.
  • c = number of pairs placed in the same cluster by Partition A, but not by Partition B.
  • d = number of pairs placed in different clusters by Partition A, but the same by Partition B.

Rand Index: RI = (a + b) / (a + b + c + d)

Total pairs: C(n, 2) = n(n − 1) / 2

Using the contingency matrix:

  • a = Σ C(nij, 2)
  • a + c = Σ C(n, 2)
  • a + d = Σ C(n·j, 2)

The calculator also reports Adjusted Rand Index, Jaccard coefficient, and Fowlkes-Mallows score for deeper comparison.

How to Use This Calculator
  1. Enter item names if you want labeled output tables.
  2. Enter the first clustering solution in Partition A.
  3. Enter the second clustering solution in Partition B.
  4. Keep both partition lists aligned in the same item order.
  5. Click Calculate Rand Index to generate the comparison.
  6. Review the score cards, contingency matrix, pair counts, and graphs.
  7. Export the computed report using CSV or PDF buttons.
Frequently Asked Questions

1) What does the Rand Index measure?

It measures pairwise agreement between two partitions of the same items. It checks whether each item pair is grouped together or kept apart in both solutions.

2) What is a good Rand Index value?

Values closer to 1 indicate stronger agreement. A value near 0 suggests weak agreement, while moderate values indicate partial similarity between the two clustering solutions.

3) Why does this page also show Adjusted Rand Index?

Adjusted Rand Index corrects for agreement expected by chance. It is often more informative when cluster counts differ or when random overlap could inflate the ordinary Rand Index.

4) Do my labels need to be numeric?

No. Labels can be numbers, words, letters, or mixed strings. The calculator compares matching positions, not the label format itself.

5) Why must both partitions have the same number of entries?

Each entry represents the same item across both solutions. Unequal lengths break item alignment, which makes pairwise comparison mathematically invalid.

6) What does the contingency matrix show?

It cross-tabulates counts from Partition A against Partition B. Large values concentrated along a few cells usually indicate stronger clustering agreement.

7) Can this calculator compare manual and algorithmic clustering?

Yes. It is suitable for comparing expert-labeled groups, machine-generated clusters, or two competing model outputs on the same item list.

8) When should I use Jaccard or Fowlkes-Mallows too?

Use them when you want more insight into positive pair matches. They can highlight behavior that the overall Rand Index alone may not fully reveal.

Related Calculators

hamming distance calculatork medoids calculatoragglomerative clustering calculatorcluster centroid calculatoradjusted rand index calculatordunn index calculatorcomplete linkage calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.