prediction Transformation

The prediction transformation produces an Einstein Discovery prediction for a dataset. Einstein Discovery uses predictive analytics, which analyzes historical data (based on data mining, machine learning, and predictive statistical modeling) to identify patterns and predict future outcomes.

Required Editions

User Permissions Needed
To add a prediction node to a dataflow: View Einstein Discovery Recommendations permission
To view predictions: View Einstein Discovery Recommendations permission (see Assign Einstein Discovery Permission Sets to Users)

After you create an Einstein Discovery story, deploying its model (see Deploy a Model ) produces a prediction definition. When you create the transformation, you identify the name of the prediction definition to use. A prediction definition contains a model to use for predicting an outcome. Einstein Discovery creates a special column in your dataset to contain the prediction score (the predicted value of the outcome, such as the likelihood that a customer churns). You also specify the name and display name of the new column.

Consider the following guidelines when creating a prediction transformation:

  • To see the Prediction button in the toolbar, Einstein Discovery must be enabled in your org, and your user account must have the View Einstein Discovery Recommendations permission. For instructions, see Set Up Einstein Discovery . zzz
  • Before you can add a prediction transformation, you must deploy the model. For instructions, see Deploy a Model .
  • Dataset column names must match the dataset column names that were used to create the story. Do not rename column names in the dataflow. Renaming column names results in missing column warnings when the dataflow completes. Other columns are ignored, such as fields created using computeExpression. The field mappings to a Salesforce object, specified when deploying the model (see Deploy a Model), do not apply to predictions in dataflows.
  • Use a prediction definition with one model. A prediction definition with multiple models (those deployed with filters) isn’t currently supported in dataflows.

prediction Transformation Properties in the Dataflow Editor

This table describes the settings for the prediction node in the dataflow editor.

Setting Required? Value
Node Name Yes Unique name that identifies this node in the dataflow JSON. Use this name to reference this node in other nodes.
Source Node Yes Dataflow node used as input for this transformation. The prediction transformation generates the prediction score based on the data provided by the input node.
Prediction Definition Yes Prediction definition to use. Click the field to select from a list of deployed prediction definitions.
Prediction Output Field Name Yes Name of the new dataset column to contain the score.
Prediction Output Field Labels Yes Label of the new dataset column to contain the score.

prediction Transformation Parameters in the Dataflow JSON

When you define a prediction transformation in the dataflow JSON, you specify the node name, action, source dataflow node, and input parameters for this transformation.

This table describes the JSON input parameters for the prediction transformation ("action": "prediction") in the dataflow.

Parameter Required? Value
predictionDefinitionName Yes Name of the prediction definition to use. The Model Manager displays prediction definition Ids. See Manage Models and Predictions .
predictionColumnName Yes Name of the new dataset column to contain the score.
predictionColumnLabel Yes UI label of the new dataset column to contain the score.
Example
Example Let's look at an example that predicts the likelihood that each customer churns and then compares the prediction against the actual outcome.
{
                "Customers": {
                "action": "edgemart",
                "parameters": {
                "alias": "Customers"
                
                },
                "edScore": {
                "action": "prediction",
                "parameters": {
                "predictionDefinitionName": "How_to_min_pAw3D_7383",
                "source": "Customers",
                "predictionColumnLabel": "Likelihood to Churn",
                "predictionColumnName": "attrition_score"
                
                },
                "Predicted": {
                "action": "computeExpression",
                "parameters": {
                "source": "edScore",
                "computedFields": [
                
                "name": "PredictedChurn",
                "saqlExpression": "case when 'attrition_score' > 0.4988 then "true" else "false" end",
                "label": "PredictedChurn",
                "type": "Text"
                
                ],
                "mergeWithSource": true
                
                },
                "Correct": {
                "action": "computeExpression",
                "parameters": {
                "source": "Predicted",
                "computedFields": [
                
                "name": "CorrectPrediction",
                "saqlExpression": "case when 'PredictedChurn' == 'Churn__c' then "true" else "false" end",
                "label": "CorrectPrediction",
                "type": "Text"
                
                ],
                "mergeWithSource": true
                
                },
                "Register": {
                "action": "sfdcRegister",
                "parameters": {
                "name": "Customers with Score",
                "alias": "CustomerWithScore",
                "source": "Correct"
                
                
                }