Creating an AutoAI experiment from sample data

When you create an AutoAI experiment, you can work with sample data to see how AutoAI works. The Bank data is a data set collected from a Portugese bank with customer information collected to measure response to a promotional campaign. The guided experience with the sample data illustrates how to build an experiment designed to predict whether a customer is likely to enroll in the promotion.

This topic describes how you can save a pipeline as a Watson Machine Learning model, deploy the model, and score it to view a prediction.

Prerequisite

  • Create a project in Watson Studio with an associated Machine Learning Service instance

Sample data

The sample data used in the guided experience is Bank marketing data used to predict whether a customer will enroll in a marketing promotions. The data is automatically uploaded and available for your use when you sect From sample as the basis for your experiment.

Steps overview

This tutorial works in concert with the guided experience in the AutoAI tool and describes how to take the sample model built in the AutoAI Experiment builder and deploy and score the resulting model to see how a prediction is generated. Follow these steps in Watson Studio:

  1. Build and train the model
  2. Deploy the trained model
  3. Test the deployed model

Watch this short video to see how to create and run an AutoAI experiment based on the bank marketing sample.

Figure 1. Video iconRun an AutoAI experiment from a sample
This video shows you how to run an AutoAI experiment based on a sample, and create a machine learning Model.

Step 1: Build and train the model

1.1 Specify basic model details

  1. From the Assets page of your project in Watson Studio, click Add to project and choose AUTOAI EXPERIMENT.
  2. In the page that opens, fill in the basic fields:
    • Specify a name and optional description for your new model.
    • Choose From Sample and click the Bank marketing sample data.
      Building from sample data
    • Confirm that the IBM Watson Machine Learning service instance that you associated with your project is selected in the Machine Learning Service section.
  3. Click Create.

1.2 Add training data

Following the prompts for the guided experience, you will see that the Bank marketing sample data is already selected for your experiment.
Bank sample data uploaded

1.3 Train the model

  1. In the guided experience, the column labeled “Y” is automatically selected for the model. This column will be used to predict whether a customer is likely to enroll in a marketing promotion. AutoAI analyzes your data and determines that the Y column contains True/False information, making this data suitable for a binary classification model. The default metric for a binary classification is ROC/AUC.
    Choosing a prediction column
  2. Click Run experiment. As the model trains, you will see an infographic that shows the process of building the pipelines.
    Building model pipelines

For a list of estimators available with each machine learning technique in AutoAI, see: AutoAI implementation detail

1.4 Choose a pipeline

Once the pipeline creation is complete, you can view and compare the ranked pipelines in a leaderboard.
Pipeline leaderboard

Choose Save model from the action menu for the pipeline with a rank of 1. This saves the pipeline as a Machine Learning asset in your project.

Step 2: Deploy the trained model

Before you can use your trained model to make predictions on new data, you must deploy the model.

You can deploy the model from the model details page. You can access the model details page in one of these ways:

  • Click on the model name in the notification displayed when you save the model.
  • Open the Assets page for the project containing the model and click the model name in the Machine Learning Model section.

From the model details page:

  • Click the Deployments tab.
  • Click Add Deployment.
  • In the page that opens, fill in the fields:
    • Specify a name for the deployment.
    • Select “Web service” as the Deployment type.
    • Click Save.

After you save the deployment, click on the deployment name to view the deployment details page.

Step 3: Test the deployed model

You can test the deployed model from the deployment details page in two ways:

Test with a form

On the Test tab of the deployment details page, click the icon to Provide input data using form, enter test data, and click Predict to see the result.
Prediction from test data

Test with JSON code

  1. On the Test tab of the deployment details page, click the icon to Provide input data as JSON and enter the following test data:
{"input_data":[{
        "fields": ["age","job","marital","education","default","balance","housing","loan","contact","day", "month","duration","campaign","pdays","previous","poutcome"],
        "values": [[27,"unemployed", "married", "primary", "no",1787,"no", "no","cellular",19,"oct", 79, 1, -1, 0, "unknown" ]]
}]}

Note that the test data replicates the data fields for the model with the exception of the prediction field.

  1. Click Predict to predict whether a customer with the entered attributes is likely to sign up for a particular kind of account. The resulting prediction indicates that a customer with the attributes entered has a very high probability of not enrolling in the marketing promotion.
    Sample banking model prediction