cdlib.algorithms.nnsed

nnsed(g_original: object, dimensions: int = 32, iterations: int = 10, seed: int = 42) → cdlib.classes.node_clustering.NodeClustering

The procedure uses non-negative matrix factorization in order to learn an unnormalized cluster membership distribution over nodes. The method can be used in an overlapping and non-overlapping way.

Supported Graph Types

Undirected Directed Weighted
Yes No No
Parameters:
  • g_original – a networkx/igraph object
  • dimensions – Embedding layer size. Default is 32.
  • iterations – Number of training epochs. Default 10.
  • seed – Random seed for weight initializations. Default 42.
Returns:

NodeClustering object

Example:
>>> from cdlib import algorithms
>>> import networkx as nx
>>> G = nx.karate_club_graph()
>>> coms = algorithms.nnsed(G)
References:

Sun, Bing-Jie, et al. “A non-negative symmetric encoder-decoder approach for community detection.” Proceedings of the 2017 ACM on Conference on Information and Knowledge Management. 2017.

Note

Reference implementation: https://karateclub.readthedocs.io/