Edges Features from NetworkX Heterogeneous Graph #2028
Unanswered
Maristela-de-Jesus
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I am trying to create my first Stellargraph from NetworkX. My NetworkX graph is Heterogeneous with nodes and edges attributes.
Node data:
[(0, {}),
(1, {'feature': [49, 4485]}),
(2, {}),
(3, {}),
(4, {'feature': [30, 2514]}),
(5, {}),
(6, {}),
(7, {}),
(8, {'feature': [29, 1968]}),
(9, {}),
(10, {'feature': [29, 1568]}),
(11, {}),
(12, {}),
(13, {'feature': [27, 1072]}),
(14, {}),
(15, {})]
Edges data:
[(1, 0, {}),
(1, 2, {'feature_edge': [0.159090909090909, 0.840909090909091]}),
(1, 3, {}),
(4, 0, {}),
(4, 5, {}),
(4, 6, {}),
(4, 2, {'feature_edge': [0.489130434782609, 1.1304347826087]}),
(4, 3, {}),
(8, 7, {}),
(8, 5, {}),
(8, 9, {}),
(8, 2, {'feature_edge': [0.166666666666667, 0.291666666666667]}),
(8, 3, {}),
(10, 7, {}),
(10, 9, {}),
(10, 11, {}),
(10, 3, {}),
(10, 12, {}),
(13, 7, {}),
(13, 14, {}),
(13, 6, {}),
(13, 15, {}),
(13, 9, {}),
(13, 11, {}),
(13, 3, {}),
(13, 12, {})]
I created the StellarGraph only with nodes attributes and it works, as per below:
sg = StellarGraph.from_networkx(newG, node_features="feature")
Now, I would like to add my edge features, but it doesn't work:
sg2 = StellarGraph.from_networkx(newG, node_features="feature",edge_features="feature_edge" )
I was reading the StellarGraph documents and I couldn't figure out how to add the edges features in my stellar graph.
Any suggestion on how I could add the edge features, please?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions