You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to utilize the Paris algorithm for hierarchical community detection.
When I attempt to visualize the network and communities, I encounter the following error:
KeyError Traceback (most recent call last)
~\anaconda3\envs\cdlib\lib\site-packages\networkx\drawing\nx_pylab.py in draw_networkx_nodes(G, pos, nodelist, node_size, node_color, node_shape, alpha, cmap, vmin, vmax, ax, linewidths, edgecolors, label, margins)
455 try:
--> 456 xy = np.asarray([pos[v] for v in nodelist])
457 except KeyError as err:
~\anaconda3\envs\cdlib\lib\site-packages\networkx\drawing\nx_pylab.py in <listcomp>(.0)
455 try:
--> 456 xy = np.asarray([pos[v] for v in nodelist])
457 except KeyError as err:
KeyError: 656
The above exception was the direct cause of the following exception:
NetworkXError Traceback (most recent call last)
<ipython-input-62-3db2159df5b2> in <module>
----> 1 viz.plot_network_clusters(G, coms)
c:\users\work\src\cdlib\cdlib\viz\networks.py in plot_network_clusters(graph, partition, position, figsize, node_size, plot_overlaps, plot_labels, cmap, top_k, min_size)
113 )
114 )
--> 115 fig = nx.draw_networkx_nodes(
116 graph, position, node_size=node_size, node_color="w", nodelist=filtered_nodelist
117 )
~\anaconda3\envs\cdlib\lib\site-packages\networkx\drawing\nx_pylab.py in draw_networkx_nodes(G, pos, nodelist, node_size, node_color, node_shape, alpha, cmap, vmin, vmax, ax, linewidths, edgecolors, label, margins)
456 xy = np.asarray([pos[v] for v in nodelist])
457 except KeyError as err:
--> 458 raise nx.NetworkXError(f"Node {err} has no position.") from err
459
460 if isinstance(alpha, Iterable):
NetworkXError: Node 656 has no position.
Should I be using an alternative visualization method?
On the github page for the Paris package (https://github.com/tbonald/paris), I see the following visualization:
from utils import plot_dendrogram
plot_dendrogram(D)
Additionally, when attempting to map the partition using coms.to_node_community_map() I lose the hierarchies between communities - is there a better way to work with the partition output?
Thanks!
The text was updated successfully, but these errors were encountered:
Hi, same issue here,
did you find any solution ?
I notice that networkx enable access to the hierarchy with the louvain algorithm
dendogram = nx.algorithms.community.louvain.louvain_partitions(G, resolution=resolution)
coms = {}
for level, p in enumerate(dendogram):
print(level, len(p))
coms[level] = p
From what I see the paris function of cdlib returns only a flat list in the NodeClustering. Am i missing something here ?
Thanks for your answer
I'm trying to utilize the Paris algorithm for hierarchical community detection.
When I attempt to visualize the network and communities, I encounter the following error:
Should I be using an alternative visualization method?
On the github page for the Paris package (https://github.com/tbonald/paris), I see the following visualization:
Additionally, when attempting to map the partition using
coms.to_node_community_map()
I lose the hierarchies between communities - is there a better way to work with the partition output?Thanks!
The text was updated successfully, but these errors were encountered: