GraKeL
GraKeL copied to clipboard
SubgraphMatching can not use normalize=True
When I try to use SubgraphMatching(normalize=True), it gives me an error:
Code:
from grakel.kernels import SubgraphMatching
k = SubgraphMatching(normalize=True) print("fit") k.fit([({(1, 2), (2, 3), (2, 1), (3, 2)}, {1: 'N', 2: 'C', 3: 'O'}, {(1, 2): ('N', 'C'), (2, 1): ('C', 'N'), (2, 3): ('C', 'O'), (3, 2): ('O', 'C')})])
print("transform") print(k.transform([({(1, 2), (2, 3), (2, 1), (3, 2)}, {1: 'N', 2: 'C', 3: 'O'}, {(1, 2): ('N', 'C'), (2, 1): ('C', 'N'), (2, 3): ('C', 'O'), (3, 2): ('O', 'C')})]))
print(k.transform([({(1, 2), (2, 3), (3, 4), (3, 5), (5, 6), (2, 1), (3, 2), (4, 3), (5, 3), (6, 5)}, {1: 'O', 2: 'C', 3: 'N', 4: 'C', 5: 'C', 6: 'O'}, {(1, 2): ('O', 'C'), (2, 3): ('C', 'N'), (3, 4): ('N', 'C'), (3, 5): ('N', 'C'), (5, 6): ('C', 'O'), (2, 1): ('C', 'O'), (3, 2): ('N', 'C'), (4, 3): ('C', 'N'), (5, 3): ('C', 'N'), (6, 5): ('O', 'C')})]))
Error:
Traceback (most recent call last):
File "try.py", line 20, in
Thank you!
Hi @anonymous-author-here ,
I tried to reproduce the error, but I could not. Have a look here: https://colab.research.google.com/drive/16dLHV-4vksiid80ryMxDlRCjHlAwOXV3?usp=sharing
Which version of GraKeL have you installed?