MCPcopy Index your code
hub / github.com/shenweichen/GraphEmbedding / test_LINE

Function test_LINE

tests/line_test.py:12–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10
11
12def test_LINE():
13 graph = nx.read_edgelist(
14 str(TEST_GRAPH_PATH),
15 create_using=nx.DiGraph(),
16 nodetype=None,
17 data=[("weight", int)],
18 )
19
20 model = LINE(graph, embedding_size=4, order="second")
21 model.train(batch_size=2, epochs=1, verbose=0)
22 embeddings = model.get_embeddings()
23 assert len(embeddings) == graph.number_of_nodes()
24 assert all(len(vector) == 4 for vector in embeddings.values())
25
26
27if __name__ == "__main__":

Callers

nothing calls this directly

Calls 3

trainMethod · 0.95
get_embeddingsMethod · 0.95
LINEClass · 0.90

Tested by

no test coverage detected