Quickstart for Kumo Relational
This quickstart uses local pandas DataFrames to build a relational schema and run a Kumo Relational prediction through an NVIDIA NIM.
The small tables are for API verification only. They do not contain enough historical examples to assess prediction quality.
Prerequisites
Before you start, make the Kumo Relational NIM available. Then install the SDK with the relational extra:
Quickstart Steps
To make your first prediction, complete the following steps:
- Prepare the related tables.
- Build a
Schemawithsdm_client.Schema.from_data()and review the inferred metadata and relationships. - Write the prediction task in PQL.
- Materialize a
RequestwithPredictiveQuery(...).materialize(indices=...). - Call
predict()with the request and theKumoRelationalmodel.
The result is a PredictionResult, and to_pandas() gives you a DataFrame. The following sections walk through this workflow.
Prepare Relational Data
Create two small related tables as pandas DataFrames:
Build a Schema
Build a Schema from the two DataFrames:
Schema.from_data() infers table metadata and relationships from the DataFrames you give it. Treat this inference as a starting point. The following pages explain how to inspect and correct it. For tables too large to load into memory, Schema.from_source samples a warehouse or database directly.
Run a Prediction
Write the question in PQL, materialize it against the entities you want scored, and predict:
This standalone example uses a context manager to create and close the client. For an application or notebook that makes multiple requests, follow the reusable client pattern.
The returned DataFrame includes row_index and, for this scalar task, prediction and probability_<class> columns. The prediction value depends on the deployed model and the supplied context.
Pass api_key to SDMClient if your deployment has an authenticating gateway.
Next Steps
Now that you have made a first prediction, explore the following resources: