How to use the karateclub.node_embedding.attributed.TADW function in karateclub

To help you get started, we’ve selected a few karateclub examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github benedekrozemberczki / karateclub / examples.py View on Github external
x = np.random.uniform(0, 1, (200, 200))

model = FSCNMF()

model.fit(g, x)

#---------------
# TADW example
#---------------

g = nx.newman_watts_strogatz_graph(200, 20, 0.05)

x = np.random.uniform(0, 1, (200, 200))

model = TADW()

model.fit(g, x)

#-----------------
# GL2Vec example
#-----------------

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

model = GL2Vec()

model.fit(graphs)
model.get_embedding()

#--------------
# FGSD example
github benedekrozemberczki / karateclub / examples.py View on Github external
from karateclub.community_detection.overlapping import EgoNetSplitter, NNSED, DANMF, MNMF, BigClam
from karateclub.community_detection.non_overlapping import EdMot, LabelPropagation
from karateclub.graph_embedding import Graph2Vec, FGSD, GL2Vec
from karateclub.node_embedding.attributed import BANE, TENE, TADW
from karateclub.node_embedding.structural import GraphWave
from karateclub.dataset import GraphReader, GraphSetReader

#-----------------------------------
# TADW example
#-----------------------------------

g = nx.newman_watts_strogatz_graph(10000, 20, 0.05)

x = np.random.uniform(0,1,(10000,200))

model = TADW()

model.fit(g, x)

quit()

#-----------------------------------
# GL2Vec example
#-----------------------------------

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

model = GL2Vec()

model.fit(graphs)
model.get_embedding()