I'm trying to run algorithms on Neo4j's Aura DS databases.
It seems like I've by and large understood how to connect to an Aura DS database, project a particular graph, then apply one of the algorithms from the graphdatascience (GDS) library in order to do node classification or solve some other machine learning problem.
However, can I somehow connect to an Aura DS database and retrieve the data in a format like pandas dataframe/tensor/numpy array/etc. and use other libraries besides GDS to train?
Apologies if this is trivial. I've tried searching for this, but got no satisfactory answer.
Aura DS and Aura DB support Cypher from python drivers. You could fetch the properties of the nodes and generate a dataframe from this.
The minor challenge here is Pandas DFs are not as forgiving as Neo4j Graphs when it comes to the schema.
So it is a better approach to fetch a list of properties from a known node and then generate a RETURN Cypher query based on the result.
Alternatively, you could just hardcode specific parameters and aliases in the 'nodesQuery' Cypher statement. But this could get tedious if you have too many columns/properties to fetch.
Ensure you change AuraDBId, dbUsername , password and yourLabel as applicable. Once you have a dataframe in Python, it should be business as usual.
Caveats: