g = nx.newman_watts_strogatz_graph(100, 10, 0.02) model = GraRep() model.fit(g) embedding = model.get_embedding() #------------------------------------ # GraphWave example #------------------------------------ g = nx.newman_watts_strogatz_graph(100, 10, 0.02) model = GraphWave() model.fit(g) embedding = model.get_embedding() #------------------------------------ # NNSED example #------------------------------------ g = nx.newman_watts_strogatz_graph(100, 10, 0.02) model = NNSED() model.fit(g)
"""GraphWave illustrative example.""" import networkx as nx from karateclub.node_embedding.structural import GraphWave g = nx.newman_watts_strogatz_graph(100, 20, 0.05) model = GraphWave() model.fit(g)