Setup Watson Studio for Predict

In this exercise you will setup and configure Watson Studio to use the Health and Predict notebook templates. The templates can be used for detecting anomalies and predicting asset failures of assets and for other purposes using Health and Predict - Utilities.

Starting with v8.9, you can use the new auto upload feature to more efficiently upload Predict notebooks into your Watson Studio project. This is an enhancement from the previous method, which required users to manually retrieve multiple credentials and upload notebooks into Watson Studio one-by-one.

After the auto upload is complete, you can start using the Predict library PMlib and the Watson Studio notebooks right away.

Get URL and User credentials to access Watson Studio

Ask your Maximo Application Suite administrator to get your user name and password for Watson Studio, API keys and URL that you will use to connect to Watson Studio. You or he can use these steps to get them.

  1. To get the Watson Studio URL, login to Maximo Application Suite. Click on Adminstration setup assets

  2. Click on Configurations and Watson Studio setup assets

  3. Click on System After you create the Watson Studio User be sure to make note of the URL, user name and password. You will use it to login to Cloud Pak for Data later with it. setup assets

  4. Open a browser to the URL and use the credentials from the previous steps to login to Cloud Pak for Data. After logging in you see your Watson Studio Overview page. setup assets

Note

Ensure Datascience User Belongs to Predict Security Group. In Maximo Manage, add the user to the PREDICT and PREDICTGROUPING group in the user definition as shown in the screen below.

Security Groups

Create a Project in Watson Studio

Watson Studio projects are where you:

  • Keep your model templates
  • Data Assets
  • Train deploy and many the Models
  • Create and manage environment for training and deploying your models.

Create a project so that you can add and setup Health, Predict and Utilities notebooks using the auto upload feature.

  1. Click on 'All Projects' where you will then create a new project. setup assets

  2. Click 'New Project'. New Project

  3. Accept default and click 'Next'. Default Value

  4. Click 'New Empty Project'. New Empty Project

  5. Enter a project name and description. setup assets

  6. After creating the project, you can now continue to upload your Predict notebooks into Watson Studio. Empty project

Auto Upload Predict Notebooks

The new auto upload feature saves considerable amount of time and allows the user to start using Predict right away. It should take less than 15 minutes to complete the entire upload. All the work is automatically done by Predict workspace’s Ansible operator in the background.

To start the auto upload, you need to get the Project ID from the Watson Studio project you just created and add it to Predict’s workspace configuration.

  1. Go to the Manage tab. Find and copy the Project ID. Alternatively, you can also retrieve it from the URL. Copy project ID

  2. Login to MAS to enter the Project ID.

  3. Click on the Administration icon on the top right corner. Enter project ID

  4. On the sidebar menu, select Workspace Go to Workspace

  5. Make sure that you are on the Overview tab. Scroll down to find the Predict widget. Workspace page

  6. Click on Predict to access the Predict workspace details. Predict widget

  7. Click on he Action menu. Click on Update configurations. Action menu button Update configurations

  8. Click the Edit button next to IBM Watson Studio Settings to update Predict configurations. Edit configuration

  9. Scroll down to Advanced settings and find IBM Watson Studio Project Settings. The System managedsetting is turned on by default. Toggle it off so that you can enter the project ID. Toggle setting OFF

  10. You should be able to see the project ID field after turning the toggle off. Paste the project ID that you retrieved from your Watson Studio project. For instances outside of of IBM hardware, you may need to specify the IBM Watson Machine Learning URL, for more details see Setup IBM Watson Machine Learning URL Paste project ID

  11. A popup will show up asking for confirmation to activate Predict. Click Activate to apply change and start activation. Activate Predict

  12. It should take roughly 15 minutes to upload all the data files and notebooks into Watson Studio. You can see the status in a widget in the details section. Preload status

  13. Once the upload is complete, go back to Cloud Pak for Data and go to your Watson Studio project. Click on the Assets tab, and you should see that all the data files are successfully uploaded, including the Predict Python PMlib zip file and the Db2 certificate file, in the data section. PMlib and Db2 certification files

  14. The process also auto-constructs an environment file. This is done by automatically retrieving 3 credentials needed to construct the file: APM _ID, APM_API_BASEURL, and EXTERNAL_APM_API_BASEURL. The only piece that was not automatically constructed is the APM_API_KEY. Please refer to one of the previous lab versions if you would like to manually find environment variables used in Predict. Environment file Environment file preview

Note

If you are logging into Cloud Pak for Data with a user other than the standard admin user, you must grant the admin user access to your project. Failure to do so will prevent Manage from exporting the data into your project with an error 'Specified project ID does not exist'.

Add admin user

Using Watson Studio Library

The Watson Studio Python Library named ibm_watson_studio_lib allows you to do to work with data assets in your project. Some examples you will learn later are reading and writing data from your project. Another example is getting the Watson Studio Project Information.

You will use a Watson Studio Python library named ibm_watson_studio_lib that is available in your environment by default to get your project information. See this API reference for more information.

Sample Code

#  Get the Watson Studio Project Information
from ibm_watson_studio_lib import access_project_or_space
wslib = access_project_or_space()
project_name = wslib.here.get_name()
wslib.show(project_name)
project_id = wslib.here.get_ID()
wslib.show(project_id)

Congratulations you have seen how to create a project auto upload Predict notebooks in Watson Studio, including the PMlib documentation you will use in the next exercises. Finally you learned how to use the ibm_watson_studio_lib to work with assets in your project.

In the next exercises you will learn how to use these notebook templates to detect anomalies and predict asset failures. You will start by update and running setup notebooks to create asset types in Health and Predict.

Setup IBM Watson Machine Learning URL

This step should only be executed after all preceeding steps have been completed and the auto upload feature returns an error. The objective is to correctly point MAS applications to Cloud Pak for Data under varying deployment configurations.

  1. Obtain your Cloud Pak for Data URL either by following the steps in this section or by copy the base url of your Cloud Pak for Data instance. Copy or save this URL for the next step.

  2. Login to MAS to enter the IBM Watson Machine Learning URL.

  3. Click on the Administration icon on the top right corner. Enter project ID

  4. On the sidebar menu, select Workspace Go to Workspace

  5. Make sure that you are on the Overview tab. Scroll down to find the Predict widget. Workspace page

  6. Click on Predict to access the Predict workspace details. Predict widget

  7. Click on he Action menu. Click on Update configurations. Action menu button Update configurations

  8. Click the Edit button next to IBM Watson Studio Settings to update Predict configurations. Edit configuration

  9. Scroll down to Advanced settings and find IBM Watson Machine Learning. The System managed setting is turned on by default. Toggle it off so that you can enter the URL. Toggle setting OFF URL

  10. You should be able to see three fields; WML URL, WML Version and WML Instance ID. Select the first field labeled WML URL and paste the the Cloud Pak for Data URL. Paste project ID

  11. A popup will show up asking for confirmation to activate Predict. Click Activate to apply change and start activation. Activate Predict

  12. It should take roughly 15 minutes to upload all the data files and notebooks into Watson Studio. You can see the status in a widget in the details section. Preload status