Creating your first Personalized Recommendation Project: Step 1 – Setup

The free tier option for Personalized Recommendation is now available as part of the Cloud Platform Enterprise Agreement (CPEA) and the Pay-As-You-Go for SAP BTP model. If you don’t have access to either of these, you can get started with Pay-As-You-Go for SAP BTP. To set up an SAP BTP global account and access the free tier model, check out this blog post by Riley Rainey. 

You can find more information about Personalized Recommendation in SAP Discovery Center and SAP Help Portal 

This blog series is all about trying out the Personalized Recommendation service. In it, I’ll show you how to get started and then walk you through the whole process – from training the model right up to calling a real-time inference. So, if you’re a business or an IT expert and are looking for ways to elevate your users’ experience and engagement while enhancing item discovery and conversion, follow this blog and see how Personalized Recommendation can enhance your use case. 

If you’ve not yet created an SAP BTP global account, check out this blog post, which explains how to do so. 

In this step of the process, we’ll be using a booster to help assign entitlements to an existing or new subaccount, create a service instance, and generate the service key for Personalized Recommendation.  

Here’s a short video that shows how to do this:

Video Walk-through of Step 1

Instance Creation and Service Key Generation with Booster 

Once you’ve created your free tier account, you’ll be directed to the SAP BTP cockpit, where you can find and manage all your subaccounts, including their instances and services. This is the initial view of the SAP BTP Cockpit user interface.  

SAP BTP Cockpit user interface

To accelerate the setup process, we’ll use the booster, which you can easily access by clicking the Booster button on the left of the screen. If the button isn’t visible, click the hamburger icon in the top-left corner of the screen.

Booster button on the SAP BTP Cockpit user interface

In the Booster section, you can see all the boosters available for different services. Click the search bar, search for Personalized Recommendation, and then click the Set up an account for Personalized Recommendation booster.

Set up an account for Personalized Recommendation

When you enter the booster, you see the overview of the booster and some additional resources relevant to Personalized Recommendation. To continue, click the Start button located in the upper right corner of the screen.

Service Overview of Personalized Recommendation 

A new window opens, showing the four-step account setup process. This process is as follows: 

  1. Check Prerequisites
    This step checks whether the new user meets all the prerequisites for the booster to complete successfully. Once the check is complete, two green DONE messages are displayed, as shown in the following screen capture.
     

    Check Prerequisites stage of the account setup process

  2. Select Scenario
    In this part of the process, you can choose from two options:
  3. Configure Subaccount
    • If you select the Create Subaccount option, refer to the details below:Entitlements: Choose the free plan for development and try-out purposes or the standard plan intended for productive usage.Subaccount Name: Give your Subaccount a name.Provider: Choose Amazon Web Services (AWS).Region: Choose Europe (Frankfurt) – Canary – AWS.Subdomain: Give your Subdomain a name.Org Name: Give your Org Name a name (customizable/auto-generated according to the name of your subdomain and global account).

      Space Name: Give your Space a name.

      See the following screen capture for reference.

      Configure Subaccount stage of the account setup process (Create Subaccount)

    • If you choose the Select Subaccount option, refer to the details below:Entitlements: Choose the free plan for free-tier users or the standard plan for non-free tier users.Subaccount: Click the dropdown to see all available subaccounts. Click the designated subaccount; the form is then filled automatically based on the subaccount.See the following screen capture for reference.

      Configure Subaccount stage of the account setup process (Select Subaccount)

  4. Review
    The last step allows you to review the entire configuration and make sure that all the information you’ve provided is correct. If it is, click the Finish button in the bottom-right corner to finish subaccount creation.

    Review Stage of the account setup process

Once the booster process for setting up your Personalized Recommendation account has finished, download the service key that has been created.  

Completion of account setup process

When you download the new service key, a window appears giving the credentials and details of the Service Key. Here, you can obtain the Service URL, ClientID, ClientSecret, and UAA URL, which you’ll need to generate the bearer token and access the Swagger API page. Below is an example of the credentials that you’re likely to encounter. 

View Service Key 

Getting the Bearer Token 

Lastly, to use the Personalized Recommendation API, you need a Bearer Token to authorize yourself before calling any API.  

  1. In the uaa section of the service key, copy the url value and paste it into the address bar of a new browser tab. Add  /oauth/token?grant_type=client_credentials after the url and choose Enter.

    View uaa section of Service Key

  2. Enter the clientid value from your service key as Username.
  3. Enter the clientsecret value from your service key as Password.
  4. Click Sign in or OK (depending on the web browser you work with).

    A browser tab at <uaa url> +  /oauth/token?grant_type=client_credentials

You should receive a response like the following: 

access token sample

Once the token has been generated, make sure to copy and save it for easy access. The token is valid for the next 12 hours following generation, so you’ll need to generate a new token after 12 hours have passed. 

Accessing the Swagger API Page 

To access the Swagger API page, you need the url (not from the uaa section) and swagger values from the service key generated earlier.

Swagger API section of the service key

In the address bar of a new browser tab, paste the url value, followed by the swagger value and hit Enter 

Authorization on the Swagger API Page 

Before using the APIs, you must authorize yourself using the Authorize button in the upper-right corner of the screen.

Authorize button on the Swagger API Page

When you click the button, a popup appears, asking you to input your Bearer Token. In the input box, make an entry with the format Bearer <your_token>, where your_token is the “access_token” value from the response received earlier.

Enter Bearer Token on the Authorize screen

Next, click Authorize to use the APIs. 

When you’ve successfully created the token and authorized yourself on the Swagger API page, click the following link to continue to the next step of this guide – Model Training and Serving.

Cheers

At this point, we have completed the service account setup and generated a token. If you have encountered any issues, feel free to leave a comment below, I will definitely help you out. Alternatively, check out the Q&A areas in the community.

In the next step, we will be using the APIs to trigger training and view the training status. Feel free to follow my profile and stay tuned for the next steps. See you in the next blog!