Testing the Prediction Studio APIs
3 タスク
10 分
シナリオ
The Prediction Studio APIs facilitate the monitoring and management of predictions remotely, using the scripting language of your choice. They offer endpoints for various operations, such as getting a list of Predictions and their attributes, introducing a challenge model, and more. These operations are categorized under Data export, Models, Reporting, Predictions, and Prediction Studio. As a System Admin, you generate the client credentials that provide access to the APIs, and then inspect the API responses.
Use the following credentials to log in to the exercise system:
| Role | User name | Password |
|---|---|---|
| System Admin | SystemAdmin | rules |
Your assignment consists of the following tasks:
Task 1: Generate the ADM export artifacts
Generate the dataflows to export the ADM model and predictor snapshots.
Task 2: Generate a Client ID and a Client Secret
Generate a Client ID and a Client Secret for access to the Prediction Studio APIs.
Task 3: Inspect the API responses
Use REST calls to try out the Prediction Studio APIs.
チャレンジ ウォークスルー
詳細なタスク
1 Generate the ADM export artifacts
- Log in as a System Architect:
- In the User name field, enter SystemAdmin.
- In the Password field, enter rules.
- In the header, click DEV STUDIO, and then switch to PREDICTION STUDIO.
- In the navigation pane of Prediction Studio, click Settings > Prediction Studio settings.
- Scroll down to the Monitoring database export section, and then click Configure to open the Export monitoring database dialog box.
- In the Export monitoring database dialog box, click Submit to generate the export artifacts.
- Close the Export monitoring database dialog box.
- In the header, click PREDICTION STUDIO, and then switch to DEV STUDIO.
2 Generate a Client ID and a Client Secret
- In the header of Dev Studio, click Create > Security > OAuth 2.0 Client Registration to create a new OAuth 2.0 Client Registration:
- In the OAuth 2.0 Client Registration short description field, enter Prediction APIs.
- In the Client Name field, enter PegaClient.
- Click Create and open.
- Configure the Client Registration:
- In the Supported grant types section, select Client credentials, and then, in the Operator ID field, enter or select DataScientist.
- In the Client Credentials section, click View & download, and then click Download credentials.
- Securely store the PegaClient_ClientCredentials text file that contains the Client ID and the Client Secret for later reference.
- Close the dialog boxes, and then click Save to complete the OAuth 2.0 Client Registration.
3 Inspect the API responses
- In the header of Dev Studio, click Application: CDH > Channels and interfaces.
- In the Current channel interfaces section, click API.
- In the Service package field, select Prediction APIs, and then click Authorize.
- In the CLIENTCREDENTIALS (OAUTH2, CLIENTCREDENTIALS) section, enter the Client ID and the Client Secret from the PegaClient_ClientCredentials text file that you saved in the previous task, and then click Authorize.
- Confirm that the client is authorized, and then click Close.
- In the Models section, click the GET /V1/models API to list the models that are part of the application.
- Click Try it out, and then click Execute.
- Review the content of the server response body, and take note of the modelId of the Web Click Through Rate GB Customer adaptive model.
- In the Models section, click the GET /v1/models/{modelID} API to get a description of the model, and then click Try it out.
- In the modelID field, enter DATA-DECISION-REQUEST-CUSTOMER-CDH!WEB_CLICK_THROUGH_RATE_GB_CUSTOMER to get a description of the Web Click Through Rate Customer adaptive model, and then click Execute.
- In the server response body, review the modeling technique, the target and alternative labels, and the predictors of the adaptive model.
- In the Data export section, click the POST /v1/datamart/export API to trigger the export of the datamart.
- On the enablement landing page, click Application Switcher > Filebrowser.
- Log in to the repository:
- Username: pega-filerepo
- Password: pega-filerepo
- Open the datamart folder and inspect the exported model snapshots and predictor snapshots files.