HomeDocsAPI Reference
Kumo.ai
Docs

Create Your PQuery

1. Click on Predictive Queries (left-hand column) → Write Predictive Query (top right-hand side).

2. Provide a name (e.g., "hm_pquery_churn") and an optional description. Select the graph you created in the previous step (e.g., "hm_graph") from the "Graph Source" drop-down menu.

3. In the "PQuery" text area, insert the following PQL statement for predicting which current active customers (i.e., customers that have purchased in the last 60 days) stop buying in the next 90 days:

PREDICT COUNT(hm_transactions.*, 0, 90, days) = 0
FOR EACH hm_customers.customer_id WHERE COUNT(hm_transactions.*, -60, 0, days) > 0

4. Click on the Next button to proceed to the "Model Plan" page.

5. Click on the Save and Train button to starting training your pQuery.


What's Next

In this quick start example, you learned how to go from raw data to predictions in the shortest amount of time possible. Some next steps include:

More Information: