コード例 #1
0
"""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)
コード例 #2
0
ファイル: examples.py プロジェクト: kmkwon94/comcomai
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()]