Predictive customer scores tools

list_predictions

Lists every ML prediction job defined in a project. Predictions compute customer-level scores such as churn probability, customer lifetime value, or propensity for a particular action. The response gives you the name, tags, archived flag, and initiative assignment.

Request parameters

NameTypeRequired?Description
project_idstrYesThe project ID returned by list_projects.

Response parameters

The tool returns a PredictionsResponse object with 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.

get_prediction

Returns the full configuration for 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_idstrYesThe prediction job ID returned by list_predictions.

Response parameters

The tool returns a PredictionResponse object with 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 list_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.


© Bloomreach, Inc. All rights reserved.