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.
- Create a project in Watson Studio.
- Auto upload Predict notebooks to automatically retrieve credentials and upload Predict notebooks into Watson Studio.
- Use Watson Studio Python library
ibm_watson_studio_lib
to do to work with data assets in your project.
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.
-
To get the Watson Studio URL, login to Maximo Application Suite. Click on
Adminstration
-
Click on
Configurations
andWatson Studio
-
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. -
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.
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.
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.
-
Click on 'All Projects' where you will then create a new project.
-
Click 'New Project'.
-
Accept default and click 'Next'.
-
Click 'New Empty Project'.
-
Enter a project name and description.
-
After creating the project, you can now continue to upload your Predict notebooks into Watson Studio.
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.
-
Go to the
Manage
tab. Find and copy the Project ID. Alternatively, you can also retrieve it from the URL. -
Login to MAS to enter the Project ID.
-
Click on the
Administration
icon on the top right corner. -
On the sidebar menu, select
Workspace
-
Make sure that you are on the
Overview
tab. Scroll down to find thePredict
widget. -
Click on
Predict
to access the Predict workspace details. -
Click on he
Action
menu. Click onUpdate configurations
. -
Click the
Edit
button next toIBM Watson Studio Settings
to update Predict configurations. -
Scroll down to
Advanced settings
and findIBM Watson Studio Project Settings
. TheSystem managed
setting is turned on by default. Toggle it off so that you can enter the project ID. -
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
-
A popup will show up asking for confirmation to activate Predict. Click
Activate
to apply change and start activation. -
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.
-
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. -
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
, andEXTERNAL_APM_API_BASEURL
. The only piece that was not automatically constructed is theAPM_API_KEY
. Please refer to one of the previous lab versions if you would like to manually find environment variables used in Predict.
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'.
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.
-
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.
-
Login to MAS to enter the IBM Watson Machine Learning URL.
-
Click on the
Administration
icon on the top right corner. -
On the sidebar menu, select
Workspace
-
Make sure that you are on the
Overview
tab. Scroll down to find thePredict
widget. -
Click on
Predict
to access the Predict workspace details. -
Click on he
Action
menu. Click onUpdate configurations
. -
Click the
Edit
button next toIBM Watson Studio Settings
to update Predict configurations. -
Scroll down to
Advanced settings
and findIBM Watson Machine Learning
. TheSystem managed
setting is turned on by default. Toggle it off so that you can enter the URL. -
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.
-
A popup will show up asking for confirmation to activate Predict. Click
Activate
to apply change and start activation. -
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.