From Data to Decisions: Integrating Predictive AI for Key Business Workflows

Enya Lu 19. September 2024 Add Intelligence, Winter 25 0
5
(2)

We’re in the midst of an AI and data revolution–and here with Data Cloud, we’re innovating quickly with Model Builder to help you take advantage of your Salesforce Data.

Model Builder transforms raw data into actionable predictions, helping you make smarter decisions and drive better results. This innovative tool empowers you to create and deploy tailored AI models to help predict outcomes, automate tasks, and surface valuable insights, all without requiring a single line of code. For learning more about building a ML model with no-code, check out our earlier article here: Build an AI Model With Clicks in Data Cloud.

But–we don’t just want to create a predictive model; we want to arm you with it so that you can make informed and efficient decisions. So, for today’s article, let’s look into all the ways you can integrate a predictive model across Salesforce.

And, if you give any of these a try after reading our article, we’d love to see it! Feel free to comment on our blog or tag me on LinkedIn.

Explainability and Actionability

Before we dive into integrations, a quick note on one of our most recent features–

Say that you are a service agent looking at a set of customers. You have a predictive model, you apply that predictive model, and it tells you–that customer X has a churn score of 90%. This is super alarming!! But that one number isn’t really that useful–you don’t know why the churn score is so high or what you should do to lower it.

Here on the Model Builder product team, we realize we don’t just want to give you a number–we want to help you make sense of that number as well. This is where we get top predictors and top improvements. For now, this is only available for no-code models, not Bring Your Own Models.

What are Top Predictors: These are the most influential features or variables that contributed to your outcome. This is key for explainability: pulling back the hood to help you understand how your model provided the result it did. As a note, the top predictors here relate to the output at the record level – i.e. what is something about that one specific record that contributed to the predicted outcome. It is different from the top predictors we show at model training, which is about variables that have the greatest impact on predicting outcome overall.

What are Top Improvements: These are actionable steps you can take to further optimize your result.

How does the model know what it can recommend or not? Well, the model looks at actionable variables.

What are Actionable Variables: An actionable variable is an explanatory variable that people can control, such as deciding which marketing campaign to use for a particular customer. Contrast these variables with explanatory variables that can’t be controlled, such as a customer’s street address or a person’s age. If a variable is designated as actionable, the model uses prescriptive analytics to suggest actions (improvements) the user can take to improve the predicted outcome.

When you first create a ML model, you can set which variables are actionable from the Integrations tab.

Integrations

Now, with your models properly set up, let’s dive into the integrations available!

Prediction Jobs

A prediction job applies a predictive model to a DMO and generates a new output DMO of prediction results. This is great for aggregate use cases: for example, in a customer segmentation use case, you could further transform the output by averaging predictions by segment. Predict jobs are also fantastic for DC-triggered flows: for example, every time a lead is at risk of churning, you could automate an email to the lead owner reminding them to reach out!

To create a prediction job, navigate to the Integrations tab of a predictive model in Einstein Studio.

From there, you’ll be launched into Inference Builder! In this step, go ahead and select which DMO you want to apply your predictive model to.

After selecting your DMO, you’ll then have to map your DMO fields to the model’s input fields. What you see on the left (Variables) represents your DMO; what you see on the right (Mapped Fields) represents the inputs required for your model.

This step is super important–in the example below, my DMO is set up so field names match input names, but it’s totally possible that you have a DMO set up differently! By doing this, you are helping the model understand which fields to look at when running the prediction.

One more step to go! Here, you want to mark if this prediction job should be streaming (i.e. it continuously updates the output as your inputs change!) or batch (i.e. one time). If you do select streaming, you also have the opportunity to select which changes in input variables will trigger a new prediction job run.

Now you’re ready! Save and name your prediction job and output DMO.

Your prediction job is now running. Something to keep in mind is that your output DMO only contains the prediction result plus primary key and primary object identifiers; it does not contain data from the DMO that you applied the predictive model to. The good news is that with Data Cloud, this output becomes super flexible: you can transform it with Data Cloud or surface on records!

We do not have top predictors and recommendations supported yet in Predict Jobs–those are forthcoming.

Data Transform

Predictive models are also available in batch data transforms, where you can apply a predictive model to a DMO and generate a new output DMO that includes prediction results.

To do so, simply add an AI node in the data transform canvas. Again, make sure to map your fields!

In batch data transforms, we also have top predictors and top recommendations available! You can configure those in Prediction Details. Every predictor or recommendation you select will add two columns to your output–Predictor/Recommendation # and Predictor/Recommendation # Impact.

You may continue your transforms or save to an output DMO. An example output DMO would be:

To understand the columns: Top Predictor 1 represents the variable name and value that contributed to a predictive result. Top Predictor 1 impact represents the number of percentage points that predictor contributed.

For example, for the first row, you can read that that record being in Germany contributed 8.21 percentage points to the predicted likelihood of win, 32.65%.

Recommendation 1 represents the variable name and value that a user could adjust that variable to. Recommendation 1 impact represents how many percentage points that adjustment would change the predictive result.

For example, for the first row, you can read a recommendation to change the discount to 35% to increase the predicted likelihood of win by 15.41 percentage points.

You can further extend these results with the power of our platform however you want.

Data Cloud Flow Action

In fact, we support predictive models in one of the most powerful platform features of Salesforce: Flows.

To apply a predictive model in Flow, create an Action node, then select the Data Cloud Action category. Select the name of your predictive model to add it to your Flow canvas!

This is a node that applies a predictive model to inputs coming from earlier in the Flow and outputs our prediction. Now, make sure to select the node and map your inputs.

If you want to receive top predictors and recommendations, scroll down to the bottom of the input mapping. Toggle to include, then set a number from 0 to 3.

Now, you can use the outputs from that node (prediction, top predictors, and top recommendations) in the rest of the Flow!

As a note, our top predictors and top recommendations output are Apex-defined data type collections. We are working to reformat these for better consumption.

For now, to understand the outputs: For top predictors, pay attention to inputValue, name, and value. In the example above, for the first predictor provided, you can read that this customer not having Streaming TV contributes to a 20 percentage point increase in likelihood of churn.

For top recommendations, pay attention to name, prescribedValue, and value. In the example above, for the first recommendation provided, you can read that changing the contract to a two-year contract may decrease the likelihood of churn by 49 percentage points.

Luckily, with prompt builder, we can actually use prompt templates to transform Apex-defined inputs into natural language. For example, you can create a Prompt with free text input that processes the top predictors output as such:

An example Json output for top predictors is: 

[{ "fields" : [ { "customText" : null, "inputValue" : "No", "label" : null, "name" : "Streaming_TV_c__c", "prescribedValue" : "" } ], "value" : 20.414}]
This means that not having Streaming TV increases the predicted value by 20.414 percentage points. 

You may be given a list of top predictors. In this case, look at and explain each individual top predictor given.

You may use a similar prompt to process top recommendations. Now, you can implement those prompts in Flow to receive your top predictors and improvements in natural language.

Note: For those API-savvy folks, visit our Data Cloud REST API documentation here to leverage predictive models.

Example Use Cases

Now that we’ve gone over integrations, there are really endless ways to combine and extend these for your organization. Let’s spotlight three specific examples:

First, you could leverage our Copilot to deliver in-context predictions conversationally. See this blog post here on how to set this up. And now, with explainability and actionability delivered, you can even achieve the example below to have Copilot provide even more context!

Second, you could build a component to surface your predictions on a record page! With this, you’ll have real-time predictions, explainability, and actionable steps easily accessible.

A third example is to leverage DC-triggered flows. You can trigger actions based on the predicted values! For example, you could create a streaming predict job on the opportunities in your org. Now, your output DMO will be refreshed every time an opportunity is edited or created. Then, use a DC-triggered flow to alert your sales reps every time the predicted win rate drops below a certain threshold. With this, you can help your sales reps manage their pipeline much more effectively!

Conclusion

In our article today, we introduced explainability and actionability, looked at all the ways we can integrate predictive models across the platform, and spotlighted three different use cases combining these integrations. We’d be incredibly interested to see what you end up building with this information!

Special thanks to Bobby Brill, Darvish Shadravan, Avni Wadhwa for their review, and Urvi Shah for documentation.

For more resources around Model Builder:

How useful was this post?

Click on a star to rate useful the post is!

Written by


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.