benedekrozemberczki / karateclub

Karate Club: An API Oriented Open-source Python Framework for Unsupervised Learning on Graphs (CIKM 2020)

Home Page:https://karateclub.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IGE Laplacian Issue for small graphs

cjchristopher opened this issue · comments

I reference here:

eigenvalues, eigenvectors = sps.linalg.eigsh(L)

The default k value for linalg.eigsh if not provided is 6, so graphs with 6 or fewer nodes create issues at this step. Without knowing the full reasoning for not specifying the k value at the histrogram stage (it is specified at the previous step of gathering the spectral features), I suggest k=min(graph.number_of_nodes() - 1, 6), although, seeing the spectral stage, or understanding the finer details in the paper, I could also see just having k=graph.number_of_nodes() -1 instead of defaulting to only 6 eigens per graph in the collection.

Hi @cjchristopher, and thank you for reporting this problem. This issue has already been patched in the method just above the one you referred to, so I am applying the first fix you have suggested there.