"""DeepWalk illustrative example.""" import networkx as nx from karateclub.node_embedding.neighbourhood import DeepWalk g = nx.newman_watts_strogatz_graph(100, 20, 0.05) model = DeepWalk() model.fit(g)
g = nx.newman_watts_strogatz_graph(100, 20, 0.05) model = Walklets() model.fit(g) emb = model.get_embedding() #------------------- # DeepWalk example #------------------- g = nx.newman_watts_strogatz_graph(100, 20, 0.05) model = DeepWalk() model.fit(g) #------------------- # Splitter example #------------------- g = nx.newman_watts_strogatz_graph(100, 20, 0.05) model = EgoNetSplitter(1.0) model.fit(g) #---------------- # Edmot example
def deepWalk(population, neighbors, probability): g = nx.newman_watts_strogatz_graph(population, neighbors, probability) model = DeepWalk() model.fit(g) #print(model.get_embedding()) return [model.get_embedding()]