上QQ阅读APP看书,第一时间看更新
Prerequisites
This section covers the steps required to experiment with Google Prediction API and Salesforce:
- You have Salesforce login credentials. If you do not have one, sign up at https://developer.salesforce.com/signup.
- Sign up for a Google account at https://accounts.google.com/SignUp?hl=en.
- Enable the Prediction API by visiting https://console.cloud.google.com/home/dashboard.
- Create a Google Cloud Project, as shown in the following screenshot. Once you create a project, note the Project ID as we will be using the Project ID in the API request:
The project creation screen in the Google console
- Sign up for a free Google cloud storage at https://console.cloud.google.com/storage/browser.
- Create a folder called salesforceeinstein and upload the provided CSV (The CSV is shared in the git repository located at (https://github.com/PacktPublishing/Learning-Salesforce-Einstein/blob/master/Chapter1/SFOpportunity.csv) in the Google Cloud storage. Name the file as SFOpportunity.csv:
- Open the prediction API explorer the (https://developers.google.com/apis-explorer/#s/prediction/v1.6/) to train the model via API. We will need to first enable OAuth for the project and use the right scope. The screenshot shows the OAuth 2.0 screen and scope enablement screen. You will need to select the auth/prediction checkbox:
- We will be using the v1.6 version of Prediction API. The training and prediction is covered in the next section.
Note that the CSV data here is a report extract of opportunity data from Salesforce. You can extract data using the Salesforce standard reporting interface. You will need to create a custom probability field on the Salesforce opportunity object to track the probability from the prediction API.
Check the following screenshot of the Dataset sample. The data samples can be taken from your Salesforce organization, and, in case you want to use the one used in this book, you can get it from the git repository (https://github.com/PacktPublishing/Learning-Salesforce-Einstein/blob/master/Chapter1/SFOpportunity.csv):