Date : March 29 2020, 07:55 AM
it helps some times A couple of these questions can be discovered by closely looking at the documentation of the functions you're using. For instance, the documentation of clusters, in the "Values" section, describes what will be returned from the function, a couple of which answer your questions. Documentation aside, you can always use the str function to analyze the make-up of any particular object. That being said, to get the members or numbers of members in a particular community, you can look at the membership object returned by the clusters function (which you're already using to assign color). So something like: summary(clusters(all2)$membership)
clusters(all2)$csize
which(clusters(all2)$membership == 128)
length(which(clusters(all2)$membership == 128)) #21
> V(all2)[clusters(all2)$membership == 128]
Vertex sequence:
[1] "625591221 - Clare Clancy"
[2] "100000283016052 - Podge Mooney"
[3] "100000036003966 - Jennifer Cleary"
[4] "100000248002190 - Sarah Dowd"
[5] "100001269231766 - LirChild Surfwear"
[6] "100000112732723 - Stephen Howard"
[7] "100000136545396 - Ciaran O Hanlon"
[8] "1666181940 - Evion Grizewald"
[9] "100000079324233 - Johanna Delaney"
[10] "100000097126561 - Órlaith Murphy"
[11] "100000130390840 - Julieann Evans"
[12] "100000216769732 - Steffan Ashe"
[13] "100000245018012 - Tom Feehan"
[14] "100000004970313 - Rob Sheahan"
[15] "1841747558 - Laura Comber"
[16] "1846686377 - Karen Ni Fhailliun"
[17] "100000312579635 - Anne Rutherford"
[18] "100000572764945 - Lit Đ Jsociety"
[19] "100003033618584 - Fall Ball"
[20] "100000293776067 - James O'Sullivan"
[21] "100000104657411 - David Conway"
|
SNMP Message with SNMP4J : Specify Read Community and Write Community?
Date : March 29 2020, 07:55 AM
Any of those help No,community string are like password, read only community string and read/write community string gives you different access for the device. If you only want to get the value from the device,you use the read only community, if you not only want to get the value and also want to change the value, you must use the read/write community. SNMP4j did not know what kind of the access you want, so it left the choice to you, you cannot set them both.
|
Using iGraph in python for community detection and writing community number for each node to CSV
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further You are on the right track; the optimal number of communities (where "optimal" is defined as "the number of communities that maximizes the modularity score) can be retrieved by communities.optimal_count and the community structure can be converted into a flat disjoint clustering using communities.as_clustering(num_communities). Actually, the number of communities can be omitted if it happens to be equal to communities.optimal_count. Once you've done that, you get a VertexClustering object with a membership property which gives you the cluster index for each vertex in the graph. For sake of clarity, I'm renaming your communities variable to dendrogram because the edge betweenness community detection algorithm actually produces a dendrogram:: # calculate dendrogram
dendrogram = graph.community_edge_betweenness()
# convert it into a flat clustering
clusters = dendrogram.as_clustering()
# get the membership vector
membership = clusters.membership
import csv
from itertools import izip
writer = csv.writer(open("output.csv", "wb"))
for name, membership in izip(graph.vs["name"], membership):
writer.writerow([name, membership])
|
Date : March 29 2020, 07:55 AM
this will help The community for each node is stored in the membership component of the result. library(igraph)
set.seed(1234)
G = erdos.renyi.game(16, 0.22)
C = cluster_louvain(G)
plot(G, vertex.color=rainbow(3,alpha=0.4)[C$membership])
|
Date : March 29 2020, 07:55 AM
|