Learn more >
Aoun Lutfi | Published December 8, 2017
Artificial intelligenceData scienceCloud
The challenge in deploying complex machine learning models is in the effort
necessary to build the runtime environment required to train and deploy the
model. IBM Cloud offers services that aim to make
this process faster and easier. In this tutorial we will demonstrate how to
deploy a machine learning model on IBM’s Watson Studio
platform while using Watson Machine Learning
(WML) without writing a single line of code! Watson Studio allows us to leverage the
computational power available on the cloud to speed up the training time of
complex machine learning models, whereas WLM allows us to deploy these models
without writing code.
Watson Machine Learning is a cloud service that allows you to build modules
that best suit your data, and then deploy these models online. It also allows
you to import custom models written in Spark MLLib and Scikit-Learn or it can
automatically select and train a model for you. It brings machine learning to
the public by allowing anyone without a development background to deploy models
IBM’s Watson Studio (Watson Studio) is a data science platform that
provides all the tools necessary to develop a data-centric solution on the
cloud. It makes use of Apache Spark clusters to provide the computational power
needed to develop complex machine learning models. You can choose to create
assets in Python, Scala, and R, and leverage open source frameworks that are
already installed on Watson Studio. You can also use Watson Studio to manage models and flows that
you deploy without having to leave the project workspace.
The aim of this tutorial is to show you how to easily build and deploy your
machine learning model without having any development skill. With WML, you will
be able to import a dataset, select the model type, run multiple estimators,
and select the best estimator for your data. You will be able to deploy the
model online, which would allow you (or your developers) to call it from
The dataset we will be using a set of employee records which we will use to
predict if an employee is likely to leave or not. The dataset is available on
note that the data is fabricated and fictional.
Before using the data we have to do a bit of clean up. Some of the columns are
not useful and would actually worsen the performance of the model. Remove the
following columns usings your favorite editor: EmployeeCount,
EmployeeNumber, Over18, and StandardHours. We are removing
EmployeeNumber because it is simply the employee number and this has no
impact on the outcome. We are removing EmployeeCount, Over18, and
StandardHours since they were the same value for all entries (1, Y, and 80
We also have to create a new IBM
Cloud account, if you haven’t
already. Additionally, we have to sign up for Watson Studio.
In a web browser, navigate to
Click on Sign Up at the top right.
Click on Sign in with your IBM id and enter your IBM Cloud credentials.
Follow the instructions to complete the sign up for IBM Watson Studio.
As soon as the Get Started button is enabled, click it and you
should be directed to the Watson Studio dashboard as shown below.
This guide will take approximately one hour to complete.
Click on the Projects tab to see a list of your projects. You should only
see a default project.
Click on the create project icon on the top right of the project list.
Type a name for your project. For instance, “ML Model”. Create a new Spark
Service and Object Storage Service as indicated on the screen. A container
is a collection of objects used for object storage. Click on Create to
create the new project. Once created, you will be directed to your new
project where you can create notebooks, import data assets, or add
From the newly created project dashboard, click the Add to project option
and select Model.
Give your model a name and then click on Associate a Machine Learning
service instance. This will open a new page to create a new Watson Machine
Learning service. Also, unless you want Watson to select the classifier for
you, select Manual model creation to be able to customize the classifier.
Click Create to proceed.
From the model page that comes up, click on Add Data Asset.
Click on the Load bar and browse for the modified .csv file you edited
earlier and wait for the upload to complete.
Select the data file and click next.
For the Column Value to Predict option, select Attrition, this is the
value we are trying to predict. For the Feature Columns, select All,
this is the default option. These options specify which columns are relevant
and which to use to try to predict the employee attrition. For the
Technique, select Binary Estimator, which means where are trying to
predict a value that is yes/no or 1/0. Note, that if we did not clean the
data earlier, we would have had to select all the columns except
EmployeeCount, EmployeeNumber, Over18, and StandardHours.
Click on Add Estimators and select all of the estimators. This tells the
model to train all estimators, which allows us to compare which performed
best and then we can select that as our final classifier.
Click Next and wait for all estimators to finish training and evaluation.
Once the training is done select the estimator with the best performance and
click the Save button.
Click on the Deployments tab to create a new deployment.
Click on Add Deployment, give it a name, and click Save. This deploys
the model and makes it publicly available on the internet, accessible
Congratulations you have now deployed a model using Watson Machine
We can now test the model online by clicking on the deployment selecting the
Test tab. It’s worth noting that the Implementation tab has code snippets
that show how to include the model into applications.
In this guide we built and deployed a model using Watson Maching Learning
without a single line of code using IBM’s Watson Studio. IBM’s Watson Studio
is more than just a development platform. It is also a
community-driven and collaboration platform. With Watson Studio you can share a project
with other users and collaborate on a specific notebook.
August 18, 2019
Get the Code »
July 22, 2019
Back to top