Predictive customer scores tools

search_predictions

Searches the ML prediction jobs in a project, or fetches one by ID. Predictions compute customer-level scores such as churn probability, customer lifetime value, or propensity for a particular action. Omit prediction_id to list all predictions — the response gives you the name, tags, archived flag, and initiative assignment. Pass prediction_id to fetch the full configuration of a single prediction job: model type (churn, lifetime value, or propensity), target event, training settings, and the customer attribute where the score is written.

Request parameters

NameTypeRequired?Description
project_idstrYesThe project ID returned by list_projects.
prediction_idstrNoThe prediction job ID. Omit to list all predictions; provide to fetch one.

Response parameters

The tool returns a PredictionsResponse when prediction_id is omitted, or a PredictionResponse when it's provided.

When prediction_id is omitted, the PredictionsResponse object has the following parameters:

ParameterTypeDescription
successboolWhether the request succeeded.
datalist[PredictionSummary]The prediction jobs defined in the project.
errorstr | nullError message if the request failed.

The PredictionSummary object has the following fields:

FieldTypeDescription
idstrThe prediction job's unique ID.
namestrThe prediction job's display name.
archivedboolWhether the prediction has been archived.
tagslist[str]User-defined tags.
initiative_idstr | nullThe initiative this prediction belongs to, if any.
createdany | nullUnix timestamp of when the prediction was created.
created_by_display_namestrDisplay name of the creator.
editedfloat | nullUnix timestamp of the last edit.
edited_by_display_namestrDisplay name of the last editor.

When prediction_id is provided, the PredictionResponse object has the following parameters:

ParameterTypeDescription
successboolWhether the request succeeded.
dataPrediction | nullThe full prediction job definition.
errorstr | nullError message if the request failed.

The Prediction object adds the following field on top of the summary record:

FieldTypeDescription
definitionany | nullThe prediction model configuration: model type (churn, lifetime value, or propensity), target event, training settings, and the output customer attribute.

get_customer_prediction_score

Returns the current prediction score for one customer in one prediction job. The tool reads the prediction's output attribute name from the job definition and then looks up that attribute on the customer's properties. The response includes the score value, the last update timestamp, the prediction's name, and the model type.

If the score is null, the model has not yet written a score for this customer. That can happen when the model has not run since the customer was created, or when the customer didn't meet the model's training criteria.

Request parameters

NameTypeRequired?Description
project_idstrYesThe project ID returned by list_projects.
prediction_idstrYesThe prediction job ID returned by search_predictions.
customer_idstrYesThe internal customer ID returned by list_customers.

Response parameters

The tool returns a CustomerPredictionScoreResponse object with the following parameters:

ParameterTypeDescription
successboolWhether the request succeeded.
prediction_namestr | nullThe prediction job's display name.
model_typestr | nullThe model type, for example churn, ltv, or propensity.
output_attributestr | nullThe customer property where the prediction score is stored.
scoreany | nullThe customer's current prediction score. Null if the score hasn't been computed yet.
last_updatefloat | nullUnix timestamp of when the score was last updated. Null if the score has never been set.
errorstr | nullError message if the request failed.


Did this page help you?

© Bloomreach, Inc. All rights reserved.