Reader small image

You're reading from  Salesforce Lightning Platform Enterprise Architecture - Third Edition

Product typeBook
Published inNov 2019
Reading LevelIntermediate
PublisherPackt
ISBN-139781789956719
Edition3rd Edition
Languages
Concepts
Right arrow
Author (1)
Andrew Fawcett
Andrew Fawcett
author image
Andrew Fawcett

Andrew Fawcett has over 30 years of experience holding several software development-related roles with a focus around enterprise-level product architecture. He is experienced in managing all aspects of the software development life cycle across various technology platforms, frameworks, industry design patterns, and methodologies. He is currently a VP, Product Management, and a Salesforce Certified Platform Developer II at Salesforce. He is responsible for several key platform features and emergent products for Salesforce. He is an avid blogger, open source contributor and project owner, and an experienced speaker. He loves watching movies, Formula 1 motor racing, and building Lego!
Read more about Andrew Fawcett

Right arrow

Adding AI with Einstein

Artificial Intelligence (AI) has become very much the norm in our personal and business lives. The reason for this is the ongoing democratization of cloud-based services that make it increasingly easy to access sophisticated AI algorithms, not just as a consumer via various AIs such as Siri, Alexa, and Google, but also as a developer. You no longer need to be a data scientist or understand the complexities of creating and executing complex models that drive such AI experiences; what you need is accurate data and a clear idea of the kind of problems—or rather AI-driven predictions—you want to discover. This is harder than you might think. Hence, the real key to AI is not the algorithms; it is the amount and quality of data! 

In this chapter, you will gain an appreciation of how Salesforce has democratized these complex new innovations...

Understanding Salesforce Einstein services and products

Salesforce provides a number of services and features, both general and specific, related to AI so as to suit different types of users, use cases, and product features. Regardless of whether you are a developer, an admin, or an end user of one of the specific clouds (such as Sales Cloud), there is likely something for you. As you would expect, the options open to developers or admins help fill in any specific gaps where Salesforce has not delivered a specific prediction need. In this section, and those that follow, we will explore these services in detail.

For administrators and data analysts, these are the options:

  • Einstein Prediction Builder: This works with the data stored in custom or standard objects to look for ways to predict a given outcome, such as the likelihood of a given customer paying on time or&...

Understanding Einstein Prediction Builder

For each prediction you set up with Prediction Builder, it scans a subset of records within a given Standard or Custom Object that you define. For each of those records, it reads a set of values from specific fields you provide (predictors). It then observes any correlations with the value of another field, which is known as the prediction field, also of your choosing.

After it has scanned the records, and when future records are created, it reviews the predictor field values and, using AI algorithms, outputs a prediction into a prediction result field. You can then use the predicted result field with an existing platform UI or reporting tools to display the prediction to the user (Process Builder rules or Apex Triggers are not supported). There are many AI algorithms available to perform this task, such as Random Forest...

Understanding Einstein Discovery

Einstein Discovery uses AI algorithms to make observations (or insights) about the datasets loaded into Einstein Analytics. To get started, you define a story that begins by asking a simple question—What is it you want to maximize or minimize?—because there can be many ways to achieve this goal. Einstein Discovery is different from Einstein Prediction Builder, which only gives one prediction and does not explain why it has reached its conclusion.

As with Einstein Prediction Builder, you start by choosing a single field that is the sole focus of your goal; this is known as the outcome measure field. This has to be a numeric field, for example, the Amount field on the Opportunity object. The question behind your goal would then be—How do I increase the size of my opportunities? Next, you select influencer...

Understanding Einstein Platform Services

You can access Einstein Platform Services through REST APIs using either Apex or other languages of your choosing. Regardless of whether you are using these services for image detection or text sentiment analysis, the following high-level process is followed:

  • Define labels that represent how you want to categorize information, such as dogs, cats, cars, vans, positive, and negative
  • Create datasets using the APIs to upload examples for each of the labels you define. You should aim to obtain around 200–500 examples per label for Einstein Language services, and at least 1,000 images per label for Einstein Vision services (for example, 1,000 images of dogs). Once again, the quality of the data you provide directly affects the accuracy of the predictions these APIs provide to your application. 
  • Create...

Summary

Salesforce has done a great job of providing a varied range of features and services to suit different needs, both for your customers directly and/or you as a package developer.

In general, Einstein Prediction Builder and Einstein Discovery (part of Einstein Analytics) are intended for your customers to implement with the data contained in your packaged Custom Objects that is accumulated during the use of your application over time. However, through this chapter, and as a result of exploring these features further, it allows you to consider what packaged fields you can add to your objects to better facilitate configuring each of these features and tools. This will reduce the effort required for customers to AI-enable your application.

If you want to deliver more AI capabilities without the customer performing configuration, you can also choose to embed AI directly...

Further reading

This chapter concludes the book, but it is not the end of your learning journey. Use the links listed here to continue to learn about new releases and gain experience through Salesforce's training platform, Trailhead: 

I hope you have enjoyed reading this book and that you go on to create the next great application that drives you and your customers to new levels of success!

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Salesforce Lightning Platform Enterprise Architecture - Third Edition
Published in: Nov 2019Publisher: PacktISBN-13: 9781789956719
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Andrew Fawcett

Andrew Fawcett has over 30 years of experience holding several software development-related roles with a focus around enterprise-level product architecture. He is experienced in managing all aspects of the software development life cycle across various technology platforms, frameworks, industry design patterns, and methodologies. He is currently a VP, Product Management, and a Salesforce Certified Platform Developer II at Salesforce. He is responsible for several key platform features and emergent products for Salesforce. He is an avid blogger, open source contributor and project owner, and an experienced speaker. He loves watching movies, Formula 1 motor racing, and building Lego!
Read more about Andrew Fawcett