Describe the bug
When the features in the VertexHistogram kernel are initialized by a sparse matrix the matrix elements are of type int64. This causes a type casting error when normalizing the kernel matrix in the transform call in line 167:
from grakel.kernels import VertexHistogram
from grakel.graph import Graph
data = [
Graph([(0, 1)], node_labels={0: "0", 1: "1"}),
Graph([(0, 1)], node_labels={0: "2", 1: "3"}),
]
kernel = VertexHistogram(normalize=True)
kernel.fit_transform(data)
kernel.transform(data)
Errornumpy.core._exceptions._UFuncOutputCastingError: Cannot cast ufunc 'divide' output from dtype('float64') to dtype('int64') with casting rule 'same_kind'
Describe the bug When the features in the VertexHistogram kernel are initialized by a sparse matrix the matrix elements are of type
int64
. This causes a type casting error when normalizing the kernel matrix in the transform call in line 167:https://github.com/ysig/GraKeL/blob/523d642faae19c870cddea2028c8d65ecfc3042c/grakel/kernels/kernel.py#L165-L168
To Reproduce
Error
numpy.core._exceptions._UFuncOutputCastingError: Cannot cast ufunc 'divide' output from dtype('float64') to dtype('int64') with casting rule 'same_kind'