Prediction Results
client.relational(graph).predict() returns Kumo Relational prediction results as a pandas DataFrame.
The DataFrame columns and number of rows depend on the prediction task.
Every result includes ENTITY, the identifier of the target entity from the prediction input.
Predictions tied to a specific point in time can also include ANCHOR_TIMESTAMP, the time from which the prediction is made.
Use these identifier fields to join predictions to downstream data instead of relying on row position.
The following example assumes that graph describes the connected input tables and query contains the prediction request.
run_mode="fast" explicitly selects the default inference mode.
Result fields
The fields that are present depend on the prediction task and the requested outputs.
Do not assume that every task returns every field or one row per input entity. The result shape varies by task:
- Binary classification and regression: One row per entity.
- Multiclass classification: One row per entity per class.
- Temporal link prediction: One row per ranked candidate.
- Forecasting: One row per entity per forecast period.
Inspect the returned DataFrame columns before processing optional outputs. For REST integrations, also check the capabilities of the deployed NVIDIA NIM model.
The Python SDK DataFrame uses uppercase PREDICTION.
The NVIDIA NIM REST response uses lowercase prediction in each prediction item.
Refer to NIM REST API when working with the REST response directly.
Illustrative shapes
Compare these examples to find the columns and row pattern for your task. They show only the column structure; the values depend on the query and the deployed release.
Scalar regression
Boolean classification
Multiclass classification
Filter the winning row for each entity with result[result["PREDICTED"]].
Do not coerce CLASS to a string because it preserves the target column’s dtype.
Forecasting
A forecasting result contains one row per entity per forecast step.
FORECAST_STEP is one-based.
Temporal link prediction with three ranked candidates
A prediction query with RANK TOP 3 returns three possible linked entities for each input entity, ordered from the highest-scoring candidate to the lowest.
Preserve the returned row order when presenting ranked candidates for the same entity.
Explanations
When explain=True, predict() returns an Explanation object instead of a bare DataFrame.
Its prediction attribute contains the prediction DataFrame, details contains the complete machine-readable explanation data, and summary contains natural-language text when the backend provides it.
See Prediction Explainability.