Closed Freyr-Wings closed 5 years ago
Also, why uses look_up
? The nodes already have their corresponding index in the edge list.
Yes, most methods based on matrix factorization need the undirected graph.
I think lookup
will be useful for the non-numeric nodes.
Then I find these two things while doing the experiment
g.read_edgelist(filename="data/wiki/Wiki_edgelist.txt", weighted=False, directed=False)
then it would be a better choice to call
adj[look_up[edge[0]]][look_up[edge[1]]] = self.g.G[edge[0]][edge[1]]['weight']
Since in graph.py you have correctly modified the graph and the sums of adj
on axis 1 and axis 0 will have same results.By which I mean, maybe one line of the code above is enough and maybe it will be better to mark the experiments which are only suitable for undirected graph
By the way, I also implement some network embedding methods myself and will make a pull request soon : )
adj[look_up[edge[0]]][look_up[edge[1]]] = 1.0
adj[look_up[edge[1]]][look_up[edge[0]]] = 1.0
The code is found in tadw and grarep. Is it means that the method can only be used in undirected graph?