Task 4: Deploying and executing the decision service
You deploy the decision service archive and execute the decision service using the
OpenAPI specification generated by the decision runtime.
Step 1: Deploying the decision service
You deploy your decision service in your Decision Intelligence Client Managed Software instance.
- Open the Share changes tab from your decision automation page.
- Select the Complete machine learning loan approval decision service.
- Click Share to commit your changes to the Git repository.
- In the Deploy tab, create a version from the latest changes by clicking the suggested option.
- Expand the created version and click Deploy at the end of the row for your decision service. Wait for the deployment to complete.
- Copy the decision ID. You will need it in Step 3 to retrieve metadata.
- Click the Test
icon at the end of the row for your deployed decision service to open the Swagger UI for the decision runtime.
Step 2: Executing the decision service
You execute the decision service using Swagger UI.
- In the Decision runtime section, expand POST /loan-validation-decision-model/execute and click Try it out.
- Enter the following schema in the request body:
{ "borrower": { "creditScore": 100, "yearlyIncome": 100000, "firstName": "Paul" }, "loan": { "numberOfMonthlyPayments": 72, "amount": 520000, "rate": 0.7 } } - Click Execute. The response body should look like
this:
{ "insurance": { "rate": 0.02, "required": true }, "approval": { "approved": false, "message": "The loan is rejected because the risk score is too high." } }
Step 3: Checking the metadata associated with your decision service
You verify the metadata that contains the machine learning provider information. These metadata are generated by Decision Designer. You may need to update them if your provider credentials change.
You must also define these metadata when deploying the decision service archive to another deployment space.
- Get the runtime Swagger UI URL from your IT team and ensure you are authenticated.
- In the Decision storage management section, expand GET /deploymentSpaces/{deploymentSpaceId}/decisions/{decisionId}/metadata.
- Click Try it out, enter the following values:
deploymentSpaceId:embeddeddecisionId: the ID you copied in Step 1.
Then, click Execute.
- The response body includes the machine learning provider description, for
example:
{ "<USER_ID>/<PROJECT_NAME>/wml-completeXXXXXX": { "name": "<USER_ID>/<PROJECT_NAME>/wml-completeXXXXXX", "kind": "ENCRYPTED", "readOnly": false, "value": { "name": "<USER_ID>/<PROJECT_NAME>/wml-completeXXXXXX", "type": "WML", "description": "Provider for the machine learning complete tutorial", "updateTime": "<UPDATE_TIME>", "authInfo": { "authType": "IAM", "apiKey": "<API_KEY>", "authUrl": "<AUTH_URL>" }, "providerAdditionalInfo": { "providerType": "WML", "mlUrl": "<ML_URL>", "spaceId": "<SPACE_ID>" }, "version": "V1" } } }