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:
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:
- Created 3 years ago
- Comments:22 (10 by maintainers)
Sorry for the late reply.
It’s embedding is not trained, and the recommendation is likely going to be random 😃