def graRep(population, neighbors, probability): g = nx.newman_watts_strogatz_graph(population, neighbors, probability) model = GraRep() model.fit(g) embedding = model.get_embedding() #print(embedding) return [embedding]
# Label Propagation example #---------------------------- g = nx.newman_watts_strogatz_graph(100, 10, 0.02) model = LabelPropagation() model.fit(g) #----------------- # GraRep example #----------------- 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)
"""GraRep illustrative example.""" import networkx as nx from karateclub.node_embedding.neighbourhood import GraRep g = nx.newman_watts_strogatz_graph(100, 20, 0.05) model = GraRep() model.fit(g)