ysig / GraKeL

A scikit-learn compatible library for graph kernels
https://ysig.github.io/GraKeL/
Other
588 stars 96 forks source link

Problems with random walk #20

Closed nikitabaldan closed 4 years ago

nikitabaldan commented 4 years ago

Hi, I've two problems with random walk kernel. The first one is that putting the flag of normalizing = True, the similarity matrix is all 1's. The second issue is that, if I put the normalizing flag = False, the diagonal of the similarity matrix is not 0. This is the code:

def computeKernelRW(graphs):
    print("-- computing kernel")
    rw_kernel = GraphKernel(kernel=[{"name": "random_walk","lamda":0.5}],normalize=False)
    return  rw_kernel.fit_transform(graphs)

And this is the call on the main:

K = computeKernelSP(graphs)
ysig commented 4 years ago

Please have a look at this past (closed) issue https://github.com/ysig/GraKeL/issues/8