benedekrozemberczki / karateclub

Karate Club: An API Oriented Open-source Python Framework for Unsupervised Learning on Graphs (CIKM 2020)
https://karateclub.readthedocs.io
GNU General Public License v3.0
2.15k stars 244 forks source link

Graph not connected false error #17

Closed asier-gutierrez closed 4 years ago

asier-gutierrez commented 4 years ago

When using GraphWave method with the same graph works on version 0.45.10 of karateclub but using the last versions shows an error of 'Graph not connected'. In that previous version the resulting embeddings were fine and worked well in tasks such as regression with Tensorflow. So it might be an error with the new version regarding the validation of the graph.

Thanks for this awesome python library!

benedekrozemberczki commented 4 years ago

Are you sure your graph is connected?

On Tue, 24 Mar 2020 at 14:26, Asier Gutiérrez notifications@github.com wrote:

When using GraphWave method with the same graph works on version 0.45.10 of karateclub but using the last versions shows an error of 'Graph not connected'. In that previous version the resulting embeddings were fine and worked well in tasks such as regression with Tensorflow. So it might be an error with the new version regarding the validation of the graph.

Thanks for this awesome python library!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/benedekrozemberczki/karateclub/issues/17, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEETMF2HNGCPECQKSKXCPKDRJC7JRANCNFSM4LSV6YFQ .

benedekrozemberczki commented 4 years ago

What happens when you run nx.is_connected(graph)?

asier-gutierrez commented 4 years ago

I have found the issue, it is related with the graph itself and how previously the connectivity was checked.

The graph contained duplicated nodes with the same IDs (I don't know why). The nx.is_connected() function function spots incoherences like that one and thus avoids the embeddings from being computed.

TLDR; it works

benedekrozemberczki commented 4 years ago

Cool :)