In this approach, you can deploy an externally trained ML model using Neo4j's Graph Data Science (GDS) library. GDS is a built-in Neo4j library that provides a variety of graph-based algorithms and machine learning functions, including support for training and deploying ML models on graph data. To deploy an externally trained ML model using GDS, you can follow these general steps:
- Train your ML model using your preferred machine learning framework, and save the trained model to a format that can be loaded by GDS (e.g., ONNX).
- Load your graph data into Neo4j.
- Use GDS to load your trained model into Neo4j. You can use the
gds.alpha.ml.loadModel
function to load your model from a file, and specify the name of the model and any additional configuration options (e.g., batch size). - Use GDS to make predictions on your graph data using your loaded model. You can use the
gds.beta.ml.predict
function to apply your loaded model to your graph data, and specify any additional configuration options (e.g., the names of the input and output node properties).
Is this approach valid? Can we load external ML models into neo4j and make predictions using cypher policies workflow?