Prediction Types
Kumo Relational uses connected tables to predict numeric values, classes, ranked items, and time series. Use this reference to choose between temporal tasks, which predict outcomes over a future time horizon, and static tasks, which infer current or unknown attributes without a time component.
Each example shows a query in Predictive Query Language (PQL), Kumo Relational’s SQL-like language for describing what to predict and which entity to predict it for.
The Python snippets run those queries with the NVIDIA Kumo Relational Client.
They assume that graph has already been defined:
Temporal Tasks (Forecast)
Temporal tasks use historical data from related tables to predict future outcomes over a defined time horizon. Every temporal prediction has three components:
- Target: What to predict, expressed as an aggregation such as
SUMorCOUNT - Entity: The row to predict for, identified by a table primary key
- Horizon: The future time window covered by the prediction
The general PQL pattern for temporal tasks is:
In this pattern, <start> and <end> define the future time window relative to “now.”
The <unit> value specifies the time granularity, such as days, hours, or minutes.
Forecast: Regression
Predict a continuous numeric value for an entity over a future time horizon.
Use cases: Demand forecasting, revenue prediction, and quantity estimation.
Supported aggregations: SUM, AVG, COUNT, MAX, MIN
Output: A numeric value for each entity. For quantile output, see Configuration.
Metrics: mae, mse, rmse, mape, smape, and r2.
Forecast: Binary Classification
Predict whether an entity will or will not experience an event within a future time window. A boolean condition applied to an aggregation expression defines the two possible outcomes.
Use cases: Customer churn prediction and event occurrence prediction.
Supported aggregations: SUM, AVG, COUNT, MAX, MIN (with a boolean condition such as = 0, > 100)
The boolean condition (= 0, > 100, etc.) on the aggregation makes this a binary classification task.
Output: A Boolean value (True or False) and a probability for each entity.
Metrics: acc, auroc, auprc, ap, precision, recall, and f1.
Forecast: Multi-Class Classification
Predict which class or state an entity will belong to at a future point in time.
Use FIRST() to predict the first value that occurs in the window, or LAST() to predict the final value.
Use cases: Tier migration, lifecycle stage prediction, and feature engagement.
Supported aggregations: FIRST, LAST
Output: One row for each entity and class, with CLASS, SCORE, and PREDICTED fields.
PREDICTED=True marks the winning class.
Metrics: acc, precision, recall, f1, and mrr.
Recommendations
Predict a ranked list of items an entity is most likely to interact with over a future time window.
Use LIST_DISTINCT() with RANK TOP N to return the top N recommended items.
Use cases: Product recommendations, content ranking, and next best action.
Supported aggregations: LIST_DISTINCT with RANK TOP N
Output: A ranked list of item IDs for each entity.
Metrics: map@k, ndcg@k, mrr@k, precision@k, recall@k, f1@k, hit_ratio@k.
Multi-Horizon Regression (Forecasting)
Predict a numeric value for an entity across multiple future time steps. This task produces a time series of predictions.
Use cases: Multi-step demand forecasting and time series prediction.
Supported aggregations: SUM, COUNT, COUNT_DISTINCT
The FORECAST N TIMEFRAMES clause tells Kumo Relational to produce N predictions, each separated by the time window specified in the aggregation, which is 7 days in this example.
Therefore, FORECAST 60 TIMEFRAMES with a 7-day window covers 60 × 7 = 420 days.
Output: Time-indexed numeric values, one for each horizon. For quantile output, refer to Configuration.
Metrics: mae, mse, rmse, mape, smape, and r2.
Static Tasks
Static tasks infer current or unknown entity attributes from an entity’s attributes and relationships. A static prediction has no future time horizon.
Every static prediction has two components: the target attribute to infer and the entity to predict it for.
The general PQL pattern for static tasks is:
Static Regression
Infer a continuous numeric attribute of an entity.
Use cases: Age estimation, price imputation, and value scoring.
Supported target type: Numeric columns
Output: A numeric value for each entity. For quantile output, see Configuration.
Metrics: mae, mse, rmse, mape, smape, and r2.
Static Binary Classification
Infer whether an entity belongs to one of two classes based on its attributes.
Use cases: Fraud detection and quality classification.
Supported target type: Boolean columns
Output: A Boolean value (True or False) and a probability for each entity.
Metrics: acc, auroc, auprc, ap, precision, recall, and f1.
Static Multi-Class Classification
Infer which single class an entity belongs to from a set of possible classes.
Use cases: Customer segmentation and category prediction.
Supported target type: Categorical columns
Output: One row for each entity and class, with CLASS, SCORE, and PREDICTED fields.
PREDICTED=True marks the winning class.
Metrics: acc, precision, recall, f1, and mrr.
Summary
Use this table to match the outcome you need with its PQL pattern and output type.