O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Learning Salesforce Einstein

Book Description

Incorporate the power of Einstein in your Salesforce application

About This Book

  • Make better predictions of your business processes using prediction and predictive modeling

  • Build your own custom models by leveraging PredictionIO on the Heroku platform

  • Integrate Einstein into various cloud services to predict sales, marketing leads, insights into news feeds, and more

  • Who This Book Is For

    This book is for developers, data scientists, and Salesforce-experienced consultants who want to explore Salesforce Einstein and its current offerings. It assumes some prior experience with the Salesforce platform.

    What You Will Learn

  • Get introduced to AI and its role in CRM and cloud applications

  • Understand how Einstein works for the sales, service, marketing, community, and commerce clouds

  • Gain a deep understanding of how to use Einstein for the analytics cloud

  • Build predictive apps on Heroku using PredictionIO, and work with Einstein Predictive Vision Services

  • Incorporate Einstein in the IoT cloud

  • Test the accuracy of Einstein through Salesforce reporting and Wave analytics

  • In Detail

    Dreamforce 16 brought forth the latest addition to the Salesforce platform: an AI tool named Einstein. Einstein promises to provide users of all Salesforce applications with a powerful platform to help them gain deep insights into the data they work on.

    This book will introduce you to Einstein and help you integrate it into your respective business applications based on the Salesforce platform. We start off with an introduction to AI, then move on to look at how AI can make your CRM and apps smarter. Next, we discuss various out-of-the-box components added to sales, service, marketing, and community clouds from salesforce to add Artificial Intelligence capabilities. Further on, we teach you how to use Heroku, PredictionIO, and the force.com platform, along with Einstein, to build smarter apps.

    The core chapters focus on developer content and introduce PredictionIO and Salesforce Einstein Vision Services. We explore Einstein Predictive Vision Services, along with analytics cloud, the Einstein Data Discovery product, and IOT core concepts. Throughout the book, we also focus on how Einstein can be integrated into CRM and various clouds such as sales, services, marketing, and communities.

    By the end of the book, you will be able to embrace and leverage the power of Einstein, incorporating its functions to gain more knowledge. Salesforce developers will be introduced to the world of AI, while data scientists will gain insights into Salesforce’s various cloud offerings and how they can use Einstein’s capabilities and enhance applications.

    Style and approach

    This book takes a straightforward approach to explain Salesforce Einstein and all of its potential applications. Filled with examples, the book presents the facts along with seasoned advice and real-world use cases to ensure you have all the resources you need to incorporate the power of Einstein in your work.

    Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the code file.

    Table of Contents

    1. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Downloading the color images of this book
        3. Errata
        4. Piracy
        5. Questions
    2. Introduction to AI
      1. Artificial Intelligence key terms
        1. Machine Learning
        2. Neural networks
        3. Deep Learning
        4. Natural language processing
        5. Cognitive computing
        6. Pattern recognition
        7. Data mining
        8. GPUs
      2. Programming languages used for machine learning
      3. Practical machine learning with Google Prediction API and Salesforce
        1. Business scenario
        2. Prerequisites
        3. Training and prediction
        4. Integration architecture
        5. Setting authentication for calling API from SFDC
        6. Drawback of this approach
      4. Summary
    3. Role of AI in CRM and Cloud Applications
      1. Sales Cloud Einstein offerings
        1. Automated Activity Capture
        2. Lead Insights
        3. Opportunity Insights
        4. Account Insights
      2. Community Cloud Einstein features
        1. The Company Highlights feature on Chatter
        2. Unanswered questions component for Community Builder
          1. Creating Salesforce Communities
        3. Recommended experts, articles, and topics
      3. Marketing Cloud Einstein features
        1. Social Studio Einstein features
        2. Personalization Builder
      4. Summary
    4. Building Smarter Apps Using PredictionIO and Heroku
      1. Introduction to PredictionIO
        1. PredictionIO platform components
      2. Architecture and integration with applications
        1. Integration with web/mobile applications
      3. Installation of PredictionIO
        1. Prerequisites
        2. Installing and configuring PredictionIO Event Server
      4. Getting started with PredictionIO
      5. PredictionIO DASE components and customization of Engine
        1. Engine design
          1. Query data structure
          2. Predicted response design
            1. Spark MLlib
            2. Data
            3. Algorithm
            4. Serving
        2. Deploying PredictionIO on Heroku
          1. Heroku Buildpack for PredictionIO
          2. Deploying an Event Server application
          3. Deploying the Template Engine
      6. Summary
    5. Product Recommendation Application using PredicitionIO and Salesforce App Cloud
      1. Introduction to Spark MLlib
      2. Setting up the Event Server app on Heroku
        1. Event Server code explanation
      3. Setting up the Recommendation engine application on Heroku
        1. PredictionIO Engine template code explanation
          1. ServerApp
          2. TrainApp
      4. Setting up IntelliJ IDEA IDE for customizing PredictionIO application
      5. Introduction to building Lightning Component for App Cloud and Community Cloud
        1. Visualforce
        2. Lightning Component framework
          1. Component
          2. JavaScript controller
          3. JavaScript Helper
          4. Component CSS file
          5. Apex controller class
      6. Building similar Recommendation Lightning Component for App Cloud
        1. Custom settings for configuration parameters
        2. The ProductViewCapture component
        3. The SimilarProductRecommender component
      7. PredictionIO commands cheat sheet
        1. GitHub references
      8. Summary
    6. Salesforce Einstein Vision
      1. Signing up for Einstein Vision account
      2. Explore Einstein Vision APIs
        1. Creation of dataset
          1. Creating a dataset from a zip file asynchronously
            1. Get status of the upload
            2. Train the dataset
            3. Get status of the training
            4. Prediction with image file
      3. Set up the Heroku add-on for Einstein Vision Services
        1. Authorization setup
          1. Procfile
          2. Obtaining the access token from Private Key
      4. Building Node.js application using Einstein Vision on Heroku using React
        1. Building React UI for image upload
          1. Scaffolding a React App
            1. The index.js file
            2. The App.js file
            3. The results.js file
        2. Middleware using Express
          1. The Episode7 module
          2. The update-token.js file
          3. The fileupload.js file
      5. Testing the application on localhost
        1. Deployment on Heroku instance
        2. Limitations of the application
      6. Summary
    7. Building Applications Using Einstein Vision and Salesforce Force.com Platform
      1. Set up authorization between Salesforce and Einstein Vision APIs
        1. Remote Site settings for Einstein API
          1. Securing Private Key
          2. Apex code utility to obtain access token
            1. Constructing JWT Encoded Body
            2. JWT Bearer token exchange
      2. Creating and training dataset via Apex
        1. Creating dataset using Apex
          1. Monitoring status of training
        2. Train dataset using Apex
      3. Creating an administration app for creating and training dataset
        1. Data model
        2. Application and tabs
        3. Trigger automation for dataset creation and training the model
      4. Creating Lightning Components to recognize image
      5. Summary
    8. Einstein for Analytics Cloud
      1. Setting up Wave Analytics Cloud
        1. Enabling access and permissions to the Analytics Cloud
          1. Creating and assigning permission sets
      2. Creating datasets, lenses, and dashboards
        1. Creating a dataset
        2. Dataflow and data manager
        3. Creating a lens from dataset
        4. Creating interactive dashboards
        5. Scheduling dataflow
      3. Using transformations to create dataset
        1. The sfdcDigest transformation
        2. The sfdcRegister transformation
        3. The append transformation
        4. The augment transformation
        5. The computeExpression transformation
        6. The computeRelative transformation
        7. The delta transformation
        8. The dim2mea transformation
        9. The edgemart transformation
        10. The filter transformation
        11. The flatten transformation
        12. The sliceDataset transformation
        13. An update transformation
      4. Wave Analytics SAQL, XMD 2.0, and dataset Row-Level Security
        1. Salesforce Analytics Query Language
        2. XMD 2.0
        3. Row-level Security for dataset
      5. Introduction to Einstein Data Discovery
        1. Sign up for a trial organization
      6. Importing Salesforce data into Einstein Data Discovery and creating stories
        1. Creating datasets from Salesforce objects
        2. Creating stories
      7. Summary
    9. Einstein and Salesforce IoT Cloud Platform
      1. IoT Cloud key terms
        1. State machine
        2. Orchestration
        3. Traffic view
      2. IoT Cloud components
        1. Input streams and data connections
        2. Data Pipes and data transformation
        3. Orchestrations
      3. Apache Kafka on Heroku
        1. Kafka API
        2. Apache Kafka on Heroku
          1. Supported languages
          2. Node.js sample code for producers and consumers
            1. Encrypting the connection between Kafka and the Heroku web app
            2. Import the Kafka Node.js module
            3. Initializing producer in your Node.js application
            4. Publish interaction events to Kafka
            5. Consuming Kafka messages
      4. IoT integration on the Salesforce Force.com platform
        1. Introducing platform events
          1. Creating platform events
          2. Publish platform events
          3. Subscribe to the platform events
            1. Using CometD to subscribe to platform events
          4. Writing unit Apex tests for platform events
        2. Introducing identity for the Internet of Things
          1. OAuth 2.0 Asset Token Flow for securing connected devices
            1. Prerequisites for implementing asset token flow in Salesforce
            2. Asset token explorer app
          2. OAuth 2.0 authentication flow for applications on limited input devices
            1. Request and Response for device initiating authentication flow
            2. Request and Response samples for polling the token endpoint
      5. Using PredictionIO on IoT events
      6. Summary
    10. Measuring and Testing the Accuracy of Einstein
      1. Measuring the accuracy of Sales Cloud Einstein
        1. Measuring the accuracy of the Einstein Lead Scoring engine
          1. Which lead field values affect conversion rates the most?
          2. Salesforce report to measure the accuracy of Lead Score
        2. Measuring the accuracy of Opportunity Insights
      2. Building evaluation metrics for the PredictionIO systems
        1. ML tuning and evaluation in PredictionIO
          1. Cross Validation
          2. Building the PredictionIO evaluation module
            1. Accuracy
            2. Precision and recall
            3. The f1 score
            4. The confusion matrix
            5. Evaluation in PredictionIO
      3. Measuring the accuracy of Salesforce Einstein Vision
        1. The Get model metrics
        2. The Get model learning curve
      4. Summary