Link prediction between nodes of two in-memory graph Using GraphSAGE algorithm

Hi,

How can I get link prediction between nodes of two in-memory graph:

Description:

Given a graph database contains:
User, Restaurant and Menu nodes, with
FRIEND(User, User), ORDER(User, Menu), VISIT(User, Restaurant), RATE(User, Restaurant), HAS_MENU(Restaurant, Menu) relations.

I create two in-memory sub-graphs: 'g_A' and 'g_B'

First sub-graph g_A obtained by cypher query includes :
User - [FRIEND]->User, and
User-[ORDER]->MENU

The Second sub-graph g_B obtained by cypher query includes :
Restaurant - [HAS_MENU]->MENU

Given those two sub-graphs, I want to generate embedding using GraphSAGE algorithm (because I also want to include node features to learn the latent features of a node) and based on the generated embeddings I want to get (top-N) prediction (Recommendation) from User -> Restaurant .
In simple words:
How likely a User will visit the restaurant that he has never visited before.

Thanks

Hey Engr,

you could use the VISIT(User, Restaurant) network to train a Link prediction model and develop predictions. Just know that both the User as the Restaurants needs vectors of the same size for features. I would suggest you use a single in-memory subgraph that contains both users and restaurants. If you want to add additional nodes to the in-memory graph, that's fine, and then run GraphSAGE on that and use the embeddings as an input to the Link prediction model. Having multiple in-memory graphs that don't encompass both restaurants and users is tricky, because you need the same feature size for restaurant and user nodes to be able to input them into a link prediction model.