adocherty / node2vec_linkprediction

Testing link prediction using Node2Vec
MIT License
68 stars 28 forks source link

KeyError: 'weight #3

Open zuozijiZHOULI opened 5 years ago

zuozijiZHOULI commented 5 years ago

Traceback (most recent call last): File "link_prediction.py", line 548, in test_edge_functions(args) File "link_prediction.py", line 343, in test_edge_functions Gtrain.train_embeddings(p, q, dimensions, num_walks, walk_length, window_size) File "link_prediction.py", line 228, in train_embeddings self.preprocess_transition_probs() File "C:\Users\zhouli\Desktop\论文研究开展资料\experiment\node2vec_linkprediction\node2vec.py", line 85, in preprocess_transition_probs unnormalized_probs = [G[node][nbr]['weight'] for nbr in sorted(G.neighbors(node))] KeyError: 'weight