If you are familiar with Predictive query, scroll down to section “5. Run & fetch results” to get the code to make prediction on your graph
What is PQL?
Predictive Query Language (PQL) is a declarative, SQL-like syntax that lets you describe an entire machine learning task in a single statement. A predictive query defines:- The target value to predict,
- The entity or set of entities to make predictions for,
- And optionally, filters that refine the feature context.
Anatomy of a Predictive Query
At its core, a predictive query follows this structure:Writing Queries in Kumo
To write a predictive query in Kumo, follow these five steps:1. Choose your entity
Select the table and primary key column that represent the entity you’ll predict for. Example:2. Define the target
The target defines what outcome or value the model should predict.It can be:
- A raw column, e.g.,
PREDICT customer_churn_flag - Or an aggregation over a future horizon, e.g.:
3. Pin the entity list
You can specify one entity or a group of entities explicitly:4. (Optional) Refine the context
Use theWHERE clause to control the feature generation window or apply static filters.For example:
5. Run & fetch results
Execute your predictive query using the RFM client:To see more examples on predictive query refer to predictive query reference