When im create my Own Dataset, how can i add edge and node feature for graph classification?

hi, I have a question, I’m a little confused, I want to do graph classification in my own data and my data include the edge feature. the tutorial for making own dataset for graph classification the example doesn’t include the edge feature and node feature. how can I add the edge feature for graph classification?
thank you so much

I have the same question. Almost tutorials are talking about models but rarely about how to build dataser from scratch :frowning:

2 Likes

If the dataset is not very large, you can simply store the node features and edge features in the corresponding graph. In the tutorial you have

# Create a graph and add it to the list of graphs and labels.
g = dgl.graph((src, dst), num_nodes=num_nodes)
self.graphs.append(g)

To store node and edge features in it

# Create a graph and add it to the list of graphs and labels.
g = dgl.graph((src, dst), num_nodes=num_nodes)
g.ndata['feat'] = ...
g.edata['feat'] = ...
self.graphs.append(g)
2 Likes

thank you so much for your response,
and I have one more question, for big data sets, can I organize my data in the form of Dortmund Data Sets, and after that use the dortmund2txt to prepare my data for GIN?

I am not familiar with Dortmund Datasets and dortmund2txt. What kind of data files will you have after applying dortmund2txt?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.