> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/sdgm/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/sdgm/_mcp/server.

# Make Predictions

> Run a Kumo Relational prediction through the NVIDIA Kumo Relational Client

After you prepare the data and build and validate a graph, write the task in Predictive Query Language (PQL), bind the graph to a `RelationalClient`, and call `predict()`. To supply labeled context examples directly instead of deriving them from a PQL query, refer to [Predict with Custom Context](/rfm/custom-context).

## 1. Write the query

```python
query = (
    "PREDICT SUM(orders.amount, 0, 30, days) "
    "FOR customers.customer_id=101"
)
```

The query identifies the target, entity, and - when applicable - the future horizon. Refer to [Write Predictive Queries](/rfm/writing-predictive-queries) for the complete authoring workflow.

## 2. Run the prediction

```python
from kumo_relational_client import RelationalClient

with RelationalClient(url="http://localhost:8000") as client:
    result = client.relational(graph).predict(query, run_mode="fast")

print(result)
```

Pass the `api_key` parameter when an authenticating gateway protects the endpoint. Use HTTPS for authenticated remote deployments.

## 3. Predict for multiple entities

For a programmatically generated list of entities, use `FOR EACH` in the query and pass the entity IDs through `indices`:

```python
with RelationalClient(url="http://localhost:8000") as client:
    result = client.relational(graph).predict(
        "PREDICT SUM(orders.amount, 0, 30, days) "
        "FOR EACH customers.customer_id",
        indices=[101, 102, 103],
        run_mode="fast",
    )
```

Kumo Relational accepts no more than 1,000 entity IDs per inference call. Refer to [Batch Prediction](/rfm/batch-prediction) for larger jobs.

## 4. Read the result

The returned pandas DataFrame uses `ENTITY` to identify the requested entity and `PREDICTION` for a scalar output. Temporal requests can also include `ANCHOR_TIMESTAMP`. Task-specific fields are conditional. See [Prediction Results](/rfm/prediction-results).

## Next steps

* [Query Kumo Relational](/rfm/querying-rfm)
* [Predict with Custom Context](/rfm/custom-context)
* [Prediction Types](/rfm/prediction-types)
* [Filters and Operators](/rfm/filters-and-operators)
* [Understand Prediction Results](/rfm/prediction-results)