Deploy and test the AutoAI experiment model using Watson Machine Learning service
According to the IBM process for data science, after a satisfactory model is developed and is approved by the business sponsors, it’s deployed into the production environment or a comparable test environment. Usually, it’s deployed in a limited way until its performance has been fully evaluated.
Using the Machine Learning service of Watson Studio, you can deploy your model in three different ways: as a web service, as a batch program, or as a real-time streaming prediction. In this tutorial, we deploy it as a web service and then test it interactively.
Once the model is deployed it can be used for prediction. However, before using it in a production environment it might be worthwhile to test it using real data. You can do this interactively or programmatically using the API for the Watson Machine Learning service. We discuss using the API in another tutorial of this learning path, but for now we continue testing it interactively.
There are two ways to interactively test the prediction: by entering the values one by one in distinct fields (one for each feature) or to specify all of the feature values using a JSON object. We use the second option because it’s the most convenient one when tests are performed more than once (which is usually the case), and when a large set of feature values is needed.
Notice that the JSON object defines the names of the fields first, followed by a sequence of observations to be predicted, each in the form of a sequence.
Be aware that some of the features, such as state and phone number, are expected to be in the form of strings (which should be no surprise), whereas the true numerical features can be provided as integers or floats as appropriate for the given feature.
To test the model at run time:
1. Select the deployment that you just created by clicking the deployment name (for example, ‘customer-churn-manual-web-deployment’).
2. deployment-list
3. This opens a new page showing you an overview of the properties of the deployment (for example, name, creation date, and status).
4. Select the Test tab.
5. Select the file icon, which allows you to enter the values using JSON.
6. Paste the sample JSON object into the Enter input data field.
7. Click Predict to view the results.
The result of the prediction is given in terms of the probability For example, the customer will churn (True) or not (False). You can try it with other values, for example by substituting the values with values taken from the ‘csv’ file. Another test would be to change the phone number to something like “XYZ” and then run the prediction again. The result of the prediction should be the same, which indicates that the feature is not a factor in the prediction.
#data #prediction #technology