How would one code the following issue:
The columns represent the k groupings from the k cluster algorithms. The rows are the N(N-1)/2 pairs of data points. If an algorithm groups a pair together (i,j) = 1 and 0 otherwise. This results in a binary matrix of size N(N-1)/2 x k. Agreement occurs if algorithms both group a pair of data points together.
How would I calculate, i.e. program, this number for all k combinations of algorithms?
https://link.springer.com/article/10.1007/BF01908075
a in this case represents the pairs of data points grouped together by algorithms 1, 2, 3, ..., k or any other combination of algorithms, for example, 2, 3 and k or 1, 2, 3 and 4. This will allow us to make an UpSet plot:
and
https://kieranhealy.org/blog/archives/2020/04/16/upset-plots/