Connecting Link Predictions from Keras Model back to Stellargraph Links - Help with the Examples #2091
-
Hi, I am trying to follow the example notebook on GraphSage link prediction. What is not clear to me from the examples, which broadly end by evaluating the Keras model and obtaining test metrics, is how to connect the Keras model predictions --- which present themselves as a matrix --- back to Stellargraph links. My feeling is these need to be reshaped in an inverse of the abstraction provided by "GraphSAGELinkGenerator." Any help or suggestions would be appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Ok ,so I am going to answer this myself. It wasn't obvious but there is no abstraction in place to incorporate Keras predictions directly back into Stellargraph graph objects. In my case I was using binary classification where the Keras model predictions simply yield "probabilities" between 0 and 1. 0 suggests the link ought not to be there whereas 1 suggests the link ought to be there. We need to join these with the relevant labels to identify the correct node pairs and then amend our Stellargraph graph as required or incorporate into another graph model, e.g. networkX or other, for further processing. |
Beta Was this translation helpful? Give feedback.
Ok ,so I am going to answer this myself. It wasn't obvious but there is no abstraction in place to incorporate Keras predictions directly back into Stellargraph graph objects. In my case I was using binary classification where the Keras model predictions simply yield "probabilities" between 0 and 1. 0 suggests the link ought not to be there whereas 1 suggests the link ought to be there. We need to join these with the relevant labels to identify the correct node pairs and then amend our Stellargraph graph as required or incorporate into another graph model, e.g. networkX or other, for further processing.