Closed funan-jhc-lee closed 3 years ago
Hi @funan-jhc-lee ,
The problem is in how you initialize the node and edge labels. In fact, the Subgraph Matching kernel expects the input graphs to contain continuous (e.g., vectors) node and edge attributes.
Therefore, in your example, you only need to initialize the node and edge labels to some values in a similar manner as here:
node_label={0:[0.0], 1:[1.0], 2:[2.0], 3:[3.0]}
edge_label={(0, 1): [1.0], (1, 0): [1.0], (1, 2): [1.0], (2, 1): [1.0], (2, 3): [1.0], (3, 2): [1.0]}
You can see here https://ysig.github.io/GraKeL/0.1a8/graph_kernel.html if and what type of labels/attributes are required to compute a given kernel.
Hi @funan-jhc-lee ,
The problem is in how you initialize the node and edge labels. In fact, the Subgraph Matching kernel expects the input graphs to contain continuous (e.g., vectors) node and edge attributes.
Therefore, in your example, you only need to initialize the node and edge labels to some values in a similar manner as here:
node_label={0:[0.0], 1:[1.0], 2:[2.0], 3:[3.0]}
edge_label={(0, 1): [1.0], (1, 0): [1.0], (1, 2): [1.0], (2, 1): [1.0], (2, 3): [1.0], (3, 2): [1.0]}
You can see here https://ysig.github.io/GraKeL/0.1a8/graph_kernel.html if and what type of labels/attributes are required to compute a given kernel. Thanks a lot! It' works. Thanks agian!
Hello! when I use the Submatching kernel, there is an error as showed in the picture above. Is there something wrong with the code I entered? Thanks a lot for your reply!