Using the RelationalAI Predictive Reasoner Locally
Get Access to the RelationalAI Native App
Section titled “Get Access to the RelationalAI Native App”To use the RelationalAI Predictive Reasoner, you’ll need access to the RelationalAI Native App. You can request access via the Snowflake Marketplace. When submitting your request, be sure to include a note indicating that you’re interested in the app’s predictive reasoning capabilities using graph neural networks (GNNs).
Once your request is approved you will receive email notification by RAI. Follow the instructions here to install the RAI Native App. Note that you will need to be a user with either ORGADMIN or ACCOUNTADMIN privileges to do the installation.
If you have already installed the RelationalAI Native App reach out to us to request enabling the predictive reasoning feature flag.
Prepare the relationalai_gnns Package
Section titled “Prepare the relationalai_gnns Package”To train models and make predictions with the RelationalAI Predictive Reasoner, you’ll need access to certain RelationalAI services via the Predictive Reasoner Python SDK. To this end, you will need the relationalai_gnns package.
To install the SDK first create and activate a conda environment:
conda create -n rai_gnn_env python==3.11conda activate rai_gnn_envThen install it:
pip install relationalai-gnnsSystem Requirements
Section titled “System Requirements”If you want to visualize the database schema you will need to install Graphviz.
Make sure Graphviz is installed on your system (for the dot binary to be available):
- macOS:
brew install graphviz - Ubuntu:
sudo apt install graphviz - Windows: Download Graphviz and add it to your PATH
To verify the installation on a Jupyter Notebook you can run the command:
!which dotwhich should point to the location that Graphviz is installed, or you can use the following sanity check:
from graphviz import Digraph
dot = Digraph()dot.node('A')dot.node('B')dot.edge('A', 'B')dot.render('test-output.gv', view=False)As a workaround if dot is in a known location you can try setting the path explicitly at the start of your imports:
import osos.environ["PATH"] += os.pathsep + "/opt/homebrew/bin"