Machine Learning Scenario: Phase 3 - Business Process

Machine Learning Scenario: Phase 3 - Business Process

The model is ready to be used in a business process. The REST-API can be called from virtually any programming language or from other applications that are designed to interface with REST-API. A common tool to test such APIs is Postman. during this exercise you will use Postman to test your REST-API.

image068
  1. Open Postman.

  2. Select the + symbol on the panel.

image069
  1. Enter the Deployment URL from the previous chapter as request URL.

  2. Extend the URL with v1/uploadjson/

  3. Change the request type to POST.

image070
  1. Enter the logon credentials.
  • Go to the Authorization tab.
  • Select Basic Auth.
  • Enter your user name and password for SAP Data Intelligence Cloud. Here you must enter the fully qualified user name. This user name starts with your tenant’s name, followed by a backslash and your actual user name. For example, f your tenant name is xa-01 and your user is , then you would enter: xa-01

image071
  1. Configure the request further:
  • Go to the Headers tab.
  • Enter the new key X-Requested-With with value XMLHttpRequest.

image072
  1. Finally, pass the input data to the REST-API, on which the prediction will be based:
  • Select the Body tab.
  • Choose raw
  • Enter this JSON syntax:

{

image073
  1. Press Send to obtain the prediction. You should see the prediction that comes from SAP Data Intelligence Cloud!

image074
  1. If you can run a half-marathon in 2 hours, the model estimates a marathon time of under 4 hours 24 minutes.
  • Try the REST-API with different values to see how the predictions change.
  • Just don’t extrapolate, stay within the half-marathon times of the training data.

Well done! You have exposed your model as a REST-API to Postman.