cancel
Showing results for 
Search instead for 
Did you mean: 

Join the community at Nodes 2022, our free virtual event on November 16 - 17.

Can't export projected graph to a new database to inspect link prediction results

Hi,
I ran Neo4j's link prediction pipeline on a graph and would like to inspect and visualize the results through Cypher queries and graph viz. Tried gds.graph.export and the graph was exported, but it created an empty database with no nodes or relationships in it.


Any help on this would be appreciated! Attached screenshots of my code and output for reference.

1 ACCEPTED SOLUTION

If your goal is just to persist/visualize the results, you can mutate your graph and then write the relationships back to your database using writeRelationship (https://neo4j.com/docs/graph-data-science/current/graph-catalog-relationship-ops/#catalog-graph-writ...)

For graph export, it looks like you've exported a graph with 1,349,603 nodes, 26,069,624 relationships and no properties. After you've done your CREATE DATABASE step, you'll want to :use household-lp in order to query it.

If that still doesn't work, please let us know the version of GDS that you're currently using (we recommend 2.0.4, the latest version).

View solution in original post

6 REPLIES 6

If your goal is just to persist/visualize the results, you can mutate your graph and then write the relationships back to your database using writeRelationship (https://neo4j.com/docs/graph-data-science/current/graph-catalog-relationship-ops/#catalog-graph-writ...)

For graph export, it looks like you've exported a graph with 1,349,603 nodes, 26,069,624 relationships and no properties. After you've done your CREATE DATABASE step, you'll want to :use household-lp in order to query it.

If that still doesn't work, please let us know the version of GDS that you're currently using (we recommend 2.0.4, the latest version).

'writeRelationship' solved my issue, thanks so much Alicia!
For export graph, it still doesn't work (I'm using version 2.0.1). Maybe there's a bug here that was fixed in newer versions..

@alicia.frame1 another related question - how do I extract out the 'train' and 'test' relationships created in the link prediction pipeline during the 'configure split' step? When printing the graph schema after running the pipeline, there weren't any newly created relationships.
I seem to have done this before, I just can't remember how, since it was a while ago.
Attached screenshots of my current projected graph (with no added relationships) as well as the old graph (with the relationships I need)

Thanks!


if you're using a pipeline, then the train/test splits are kept internal to the pipeline.

If you want to split your data for some downstream use: Split Relationships - Neo4j Graph Data Science

Hi @alicia_frame1, I used 'split relationships' and I'm currently trying to use gds.alpha.ml.linkPrediction.train to train my graph, but got an error saying:

There is no procedure with the name `gds.alpha.ml.linkPrediction` registered for this database instance. 

 I have the required Neo4j and GDS versions installed (4.3.9 and 2.0) mentioned here (I'm not using APOC so I didn't download that) - https://neo4j.com/developer/graph-data-science/link-prediction/graph-data-science-library/

Any help is appreciated, thanks!

If you're using 2.0, we've deprecated the independent link prediction procedure and replaced it with link prediction pipelines - which graduated to the beta tier. More details and examples are available here: https://neo4j.com/docs/graph-data-science/2.0/machine-learning/linkprediction-pipelines/

You may also want to take a peak at the migration guide for 1.x --> 2.0; we provide a mapping for gds.alpha.linkPrediction to gds.beta.pipeline.linkPrediction: https://neo4j.com/docs/graph-data-science/2.0/appendix-b/migration-ml/#migration-algorithms-link-pre...