I'm really close to understanding the adjusted rand index, but I lack a background in formal maths and I'm struggling to grasp one or two things.
I've been using the Wikipedia page primarily. I've calculated the rand index for some pretend data.
The only part I'm struggling with is calculating nij, ai and bj. Am I adding every occurrence of them together? Or a singular row? A singular row wouldn't give the adjusted rand index would it?
Say I have two sets with two pairs in common between them, the total value of bj is going to be two, the total value of ai is also going to be two and nij is also two. This doesn't seem right for them all to be the same value?
Here's an example contingency table.
x1 x2 x3 y1 0 0 0 y2 0 1 0 y3 0 1 0
I get that I sum these up to make ai or bj, but I think I must be calculating it wrong?