Sunil Bhardwaj
9 min readJun 25, 2023

Preparatory Notes for The Einstein Prediction Builder Accredited Professional exam : Part 3

Quick Start: Einstein Prediction Builder

— To build an app to predict which restaurant reservations will be no-shows.

Sign up for a special Trailhead Playground with Einstein Prediction Builder.

Create a Formula Field to Predict

Add a Checkbox Field

In Object Manager, you can see that it has a:

  • Reservation, a custom object. Each Reservation record represents a customer’s reservation at one of Pizzaiolo Marco’s restaurants.
  • Status, a picklist field on the Reservation object with options that include:
  • Completed
  • No Show
  • Upcoming

You want to predict the likelihood that customers will be a no-show. In a nutshell, you want to know which reservations are likely to eventually have: Status = “No Show.” Einstein Prediction Builder can answer your questions in a yes/no format: “Is this customer’s reservation likely to result in a No Show? Yes or no?” That means you need to provide your historical data in the same yes/no format. In Salesforce, that’s a checkbox field. So let’s create a custom formula checkbox field for No Show.

Object Manager >> In the Quick Find box, select for Reservation object >> Fields & Relationships >> New >> Formula data type >> click Next

In the Field Label, enter No Show . Then choose the Checkbox formula return type and click Next

On the Simple Formula tab, in the No Show (Checkbox) field, enter this formula and click Next.

ISPICKVAL(Status__c,”No Show”)

This formula will return a True value if the reservation resulted in a no-show, and a False value otherwise. That’s just what we’re looking for in our prediction.

Leave the default options for field-level security and click Next.

Leave the default options for page layout. Then click Save.

Enrich Your Prediction

Give Your Prediction More Data

Your online reservation app is already collecting some customer data that might be useful for predicting no-shows. For example:

  • Where they live
  • Marital status
  • Occupation
  • Date and time of reservation
  • Whether they’re a rewards member
  • Total number of reservations they’ve booked

You want to enrich your prediction with this previous no-show data.

Since you are building a prediction on the Reservation object, you need to add the previous no-show data onto that object for Einstein Prediction Builder to consider it. Before you create your prediction, make sure to complete all fields.

First you create a custom Roll-Up Summary field called “Previous No Shows” on the Contact object.

Object Manager >> In the Quick Find box, search for Contact and select the object >> Fields & Relationships >> New >> Roll-Up Summary data type >> Click Next

In the Field Label, enter Previous No Shows, and click Next >> For Summarized Object, select Reservations >> Select the COUNT roll-up type >> In Filter Criteria, select Only records meeting certain criteria should be included in the calculation >> Select the No Show field and Equals operator. For Value, enter True

Leave the default option for field-level security, and click Next.

Leave the default option for page layouts. Then click Save.

Add Previous No Shows to Your Prediction

Next, you create a custom Previous No Shows field on the Reservation object so that Einstein Prediction Builder can see this information when making its prediction about Reservations.

Object Manager >> In the Quick Find box, search for and click Reservation >> Fields & Relationships >> New >> Select the Formula data type, then click Next.

For Field Label, enter Previous No Shows. Select Number for the formula return type, and select 0 for decimal places. Click Next.

Click the Advanced Formula tab and click Insert Field.

With the Reservation object selected, click Contact >.

Select Previous No Shows and click Insert.

Leave the default options for field-level security and click Next.

Leave the default options for page layouts. Then click Save.

Add an Upcoming Reservation to Your Prediction

Next, on the Reservation object, create a future reservation so that Einstein can start scoring your prediction data. For this to happen, Einstein Prediction Builder needs at least one record to predict so you can build the prediction.

In the Quick Find box, enter Reservations and select the object >> On the Reservations tab, click New to create a reservation >> Enter a reservation date and time in the future. For example, on New Year’s Eve at 7:00 pm >> In the Contact field, enter Ab Spellman as your reservation contact >> In the Status field, select Upcoming to schedule a future booking >> Leave the party size of 2, and click Save.

Build a Prediction

Time to Create Your Prediction

Steps: In the Quick Find box, enter Einstein Prediction Builder and select Einstein Prediction Builder. Or, click Get Started on the Einstein Prediction Builder tile >> If this is the first time you’re using Einstein Prediction Builder in this special new org, click Review Terms and read all the terms to try Einstein Prediction Builder. Then select I’m authorized by my company to accept these terms, and click Try Einstein. >> On the splash page, click Get Started to set up and launch Einstein Prediction Builder. If you’re still waiting after a few minutes, refresh your browser to see if you can start building your prediction. >> Click New Prediction.

On the Name & Type page, enter No Show Prediction for your prediction name.

To define your prediction type, select the Yes/No prediction because we’re predicting whether or not a customer is likely to be a no-show. Then click Save & Next.

On the Object page, enter Reservation and select the object. Then click Save & Next. Data Checker automatically checks if you have enough records in your dataset for Einstein to build a prediction.

On the Segment page, specify which reservation records you want Einstein to consider. In this case, leave the default All Reservations option selected. Then click Next.

On the Example Records page, define your example or training set. You want to use past reservations to find out whether customers are likely to be no-shows or not.
First, specify the Yes Example. Leave the default Meet All Conditions selection for your filter. Select the Status field, the Equals operator, the Picklist type, and the No Show value.

Now define the No Example. Leave the default Meet All Conditions selection for your filter. Select the Status field, Equals operator, Picklist type, and Completed value. Then click Save & Next. If Data Checker shows “0 Records to predict” don’t worry! That’s just because you’re working in a simulated environment. After you build your prediction and verify this step, lots of records will have predicted values.

On the Included Fields page, review the fields for Einstein to analyze to make a prediction. In this case, leave all the fields selected, and click Next.

On the Records to Predict page, select Predict on all records that aren’t example records. Then click Next.

On the Score Field page, name the field where Einstein saves your prediction results (scores). Enter Predicted No Show for the Field Label and tab to populate the field name. Then click Save & Next.

On the Review & Build page, review your prediction settings. To make a change, go to the relevant page to adjust your selections. Data Checker runs one final time to make sure Einstein can build a prediction based on the way you’ve set up your data. Once you’re satisfied, click Build.

It can take a few hours for Einstein to analyze your data and build predictions. Although the process seems a lot faster in this project, it may still take at least 30 mins to score your prediction.

Once building has finished, you’ll find your prediction in the List View in Einstein Prediction Builder. On the No Show Prediction, navigate to the bottom right icon and click View Scorecard.

The scorecard lets you understand the prediction quality so you can decide whether or not to enable the prediction.

On your prediction, navigate to the bottom right icon once again. Then click Enable so Einstein can start scoring your prediction data.

Click Verify Step and proceed to the next step in the project.

Create a List View for Your Predictions

See Your Predictions in One Place

The list view makes it easy to prioritize your confirmation calls.

Steps: Click App Launcher Icon and select Reservations >> Click Reservations in the navigation bar. Now you’re looking at a list of all your reservations. Let’s make a list of only those you need to call to confirm. >> Click Gear Icon and select New to create a list view. >> For List Name, enter Call to Confirm. >> Select All users can see this list view and click Save >> Click Gear Icon again and choose Select Fields to Display. In the Available Fields list, select these fields and use the right arrow to move them to the Visible Fields list.

  • Contact
  • Predicted No Show
  • Status

Click Save. >> If you don’t see a Filters panel, click the filter icon to display it. Click Add Filter. >> For Field, select Status. For Operator, select equals, and for Value, select Upcoming. Click Done and Save. Now you see a list of all your upcoming reservations. >> Let’s narrow it further to see only those we want to call to confirm. Click Add Filter again. >> For Field, select Predicted No Show. For Operator, select greater or equal. Enter 20 for the Value. Click Done. >> In the Filters panel, click Save. Now you have a list of your riskiest reservations.

** To recap, in just a few steps, you let Einstein evaluate your reservations data and predict the likelihood that a reservation will be a no-show. Then you used those predictions to power a workflow that ultimately helps you fill more seats, increase efficiency, and work smarter.

Happy Learning! ✍️

Please follow me at Twitter : https://www.twitter.com/sunilbhardwaj1

LinkedIn : https://www.linkedin.com/in/sunilbhardwaj10

References:

Sunil Bhardwaj
Sunil Bhardwaj

Written by Sunil Bhardwaj

I'm Salesforce CRM Analytics Ambassador (2023 & 2022). I'm working with HCL as Salesforce Lead Consultant. I always enjoy helping people & being a Trailblazer!

No responses yet