question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Loading data from dataframe to bipartite graph

See original GitHub issue

❓ Questions & Help

I am new into pytorch_geometric and i am trying to use BipartiteData class to load data from dataframe which looks something like this:

image

weight_of_edge : means how many times customer_id order from vendor_id

Wanted to know if I passing correctly the data from my dataframe to the BipartitData class ?

This are my variables defined from dataframe to fed BipartitData: weight = (torch.Tensor(df['weight_of_edg'].values)).long() customer_id = (torch.Tensor(df['customer_id'].values)).long() vendor_id = (torch.Tensor(df['vendor_id'].values)).long() edge_index = torch.Tensor((np.vstack((customer_id, vendor_id)))).long()

Finally i passed this way: data = BipartiteData(edge_index, customer_id, vendor_id) data.edge_attr = weight

Is this okay? Thanks you very much ! keep with the excellent job 😃 !

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:22 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
rusty1scommented, Jan 26, 2022

Sorry for the late reply.

  1. If you rely on learned embeddings for certain node types, you have to train any new embedding as well. You can either do that by re-training your model with the new node (with can become expensive), or only train the embedding for the new node while holding all other parameters fixed.
  2. Yes, I think this is indeed hybrid as well, but I’m not aware of any paper explaining that in detail.
1reaction
rusty1scommented, Jan 19, 2022

It’s embedding is not trained, and the recommendation is likely going to be random 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Construct bipartite graph from columns of python dataframe
I want a bipartite graph stating that example.org has a weight of 3 as it has 3 edges on it etc. And I...
Read more >
Loading data from dataframe to bipartite graph #1999 - GitHub
Questions & Help I am new into pytorch_geometric and i am trying to use BipartiteData class to load data from dataframe which looks ......
Read more >
Working with Bipartite graph data in pandas - notes_and_demos
The most common form for representing graph data is called an 'edge list', so we will start with one of those in pandas....
Read more >
Load bipartite graphs with igraph - RPubs
Bipartite graph is a graph whose nodes can be devided into two disjoint sets and edges connects these two (U,V) independent sets. There...
Read more >
NETWORK ANALYSIS IN PYTHON II - Amazon S3
Activities in the chapter: ○. Constructing a graph from a pandas DataFrame. ○. Computing unipartite projections of a bipartite graph. ○. Visualization.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found