示例#1
0
#-------------------------
# GraphSet reader example
#-------------------------

reader = GraphSetReader("reddit10k")

graphs = reader.get_graphs()
y = reader.get_target()

#----------------------
# Graph reader example
#----------------------

reader = GraphReader("facebook")

graph = reader.get_graph()
target = reader.get_target()

#-------------------------------
# Graph2Vec attributed example
#-------------------------------

graphs = []

for i in range(50):
    graph = nx.newman_watts_strogatz_graph(50, 5, 0.3)
    nx.set_node_attributes(graph, {j: str(j) for j in range(50)}, "feature")
    graphs.append(graph)
model = Graph2Vec(attributed=True)

model.fit(graphs)
示例#2
0
#-----------------------------------
# GraphSet reader example
#-----------------------------------

reader = GraphSetReader("reddit10k")

graphs = reader.get_graphs()
y = reader.get_target()

#-----------------------------------
# Graph reader example
#-----------------------------------

reader = GraphReader("facebook")

graphs = reader.get_graph()
target = reader.get_target()
#-----------------------------------
# Graph2Vec example
#-----------------------------------

graphs = [nx.newman_watts_strogatz_graph(50, 5, 0.3) for _ in range(1000)]

model = Graph2Vec()

model.fit(graphs)
model.get_embedding()

#-----------------------------------
# BoostNE example
#-----------------------------------