MCPcopy
hub / github.com/dmlc/dgl / process

Method process

python/dgl/data/karate.py:55–64  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

53 )
54
55 def process(self):
56 kc_graph = nx.karate_club_graph()
57 label = np.asarray(
58 [kc_graph.nodes[i]["club"] != "Mr. Hi" for i in kc_graph.nodes]
59 ).astype(np.int64)
60 label = F.tensor(label)
61 g = from_networkx(kc_graph)
62 g.ndata["label"] = label
63 self._graph = g
64 self._data = [g]
65
66 @property
67 def num_classes(self):

Callers

nothing calls this directly

Calls 2

from_networkxFunction · 0.50
astypeMethod · 0.45

Tested by

no test coverage detected