igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] Compare clusterings


From: Tamas Nepusz
Subject: Re: [igraph] Compare clusterings
Date: Fri, 23 Jul 2010 17:19:50 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

>   Hello!  I installed igraph as an R package. If i run two clustering
>   algorithms on the same graph and i have the two membership vector
>   then, how can i compare the two partitions? I would like to know
>   which points changed their cluster?  Thank you  Albert
Well, the problem is not as simple as it seems; consider the following
two membership vectors:

c(1,1,1,1,2,1,2,2,2,2)
c(2,2,2,2,2,1,1,1,1,1)

The simplest solution would be the following:

> which(x != y)
[1]  1  2  3  4  7  8  9 10

But this is obviously wrong, since if we associate cluster 1 in the
first vector with cluster 2 in the second vector and vice versa, then it
is easy to see that only positions 5 and 6 have changed. The problem
becomes even more complicated if there are more than two clusters and
the number of clusters is not equal in the two vectors. For instance,
which points would you consider to have changed their membership here?

c(1,1,1,1,2,2,2,2,3,3,3,3)
c(1,2,1,2,1,2,1,2,1,2,1,2)

-- 
Tamas



reply via email to

[Prev in Thread] Current Thread [Next in Thread]