Graph2Vec Error
rodrigo-arenas opened this issue · comments
Hi, I'm trying to use Graph2Vec with a simple DiGraph but I'm getting an error; I'm quite new to the package so I'm not sure if I'm doing something wrong.
I'm using networkx version 2.6.3 and karateclub 1.3.0
import networkx as nx
from karateclub.graph_embedding import Graph2Vec
edge_list = [('A', 'B'), ('B', 'C'), ('C', 'D'), ('D', 'J'),
('D', 'I'), ('J', 'I'), ('I', 'F'), ('I', 'E'),
('I', 'L'), ('F', 'D'), ('E', 'K'), ('K', 'I'), ('L', 'M')]
G = nx.DiGraph()
for edge in edge_list:
G.add_edge(*edge)
graph_vect = Graph2Vec()
graph_vect.fit([G])
Please read the paper - node indices should be numbers starting with 0.
…On Wed, 22 Jun 2022 at 16:17, Rodrigo Arenas ***@***.***> wrote:
Hi, I'm trying to use Graph2Vec with a simple DiGraph but I'm getting an
error; I'm quite new to the package so I'm not sure if I'm doing something
wrong.
I'm using networkx version 2.6.3 and karateclub 1.3.0
import networkx as nxfrom karateclub.graph_embedding import Graph2Vec
edge_list = [('A', 'B'), ('B', 'C'), ('C', 'D'), ('D', 'J'),
('D', 'I'), ('J', 'I'), ('I', 'F'), ('I', 'E'),
('I', 'L'), ('F', 'D'), ('E', 'K'), ('K', 'I'), ('L', 'M')]
G = nx.DiGraph()for edge in edge_list:
G.add_edge(*edge)
graph_vect = Graph2Vec()graph_vect.fit([G])
I get the following error:
[image: image]
<https://user-images.githubusercontent.com/31422766/175066619-c35fcc87-0bfa-4d08-bc8d-9f2d043aa73e.png>
—
Reply to this email directly, view it on GitHub
<#99>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEETMF43FDHHRIYKAPIROFLVQMU7TANCNFSM5ZQT65HA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
Alright, thanks