Quick start: Build and deploy a machine learning model with AutoAI

You can automate the process of building a machine learning model with the AutoAI tool. Read about the AutoAI tool, then watch a video and take a tutorial that’s suitable for beginners and does not require coding.

Required service Watson Machine Learning

Your basic workflow includes these tasks:

  1. Create a project. Projects are where you can collaborate with others to work with data.
  2. Add your data to the project. You can add CSV files or data from a remote data source through a connection.
  3. Create an AutoAI experiment in the project.
  4. Review the model pipelines and save the desired pipeline as a model to deploy or as a notebook to customize.
  5. Deploy and test your model.

Read about AutoAI

The AutoAI graphical tool in Watson Studio automatically analyzes your data and generates candidate model pipelines customized for your predictive modeling problem. These model pipelines are created iteratively as AutoAI analyzes your dataset and discovers data transformations, algorithms, and parameter settings that work best for your problem setting. Results are displayed on a leaderboard, showing the automatically generated model pipelines ranked according to your problem optimization objective.

Read more about AutoAI

Watch a video about creating a model using AutoAI

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

Video disclaimer: Some minor steps and graphical elements in this video differ from your Cloud Pak for Data deployment. This video shows the Cloud Pak for Data as a Service user interface.

This video provides a visual method as an alternative to following the written steps in this documentation.

Try a tutorial to create a model using AutoAI

In this tutorial, you will complete these tasks:

  1. Create a project.
  2. Build and train the model.
  3. Promote the model to a deployment space and deploy the trained model
  4. Test the deployed model.

This tutorial will take approximately 30 minutes to complete.

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.

Task 1: Create a project

You need a project to store the AutoAI experiment.

  1. If you have an existing project, open it. If you don't have an existing project, click Create a project on the home page or click New project on your Projects page.
  2. Select Analytics project as the project type.
  3. Select Create an empty project.
  4. On the Create a project screen, add a name and optional description for the project.
  5. Click Create.

For more information or to watch a video, see Creating a project.

Task 2: Build and train the model

Create the AutoAI experiment, review the model pipelines, and select a pipeline to save as a model.

  1. Download the bank.csv file (0.46 MB) file.
  2. From the Assets tab of your project, click Add to project > AutoAI Experiment.
  3. On the Create a an AutoAI Experiment screen, add a name and optional description for the project.
  4. Click Create.
  5. On the Add data source page that opens, click Browse and open the bank.csv.
  6. If you are asked to create a time series experiement, select No.

  7. Select the column labeled "Y" 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 accuracy and run time.

  8. Based on the data set and the selected column to predict, AutoAI analyzes a subset of the data and chooses a prediction type and metric to optimize. In this case, the prediction type is Binary Classification, the positive class is Yes, and the optimized metric is Accuracy and run time.

  9. Click Run experiment. As the model trains, you will see an infographic that shows the process of building the pipelines.
  10. Once the pipeline creation is complete, you can view and compare the ranked pipelines in the leaderboard.
  11. Select the highest ranked pipeline, and choose Save model from the action menu. This saves the pipeline as a Machine Learning asset in your project.
  12. When the model is saved, click the View in project link in the notification to view the model in your project. Alternatively, you can navigate to the Assets tab in the project, and click the model name in the Machine Learning Model section.

Task 3: Promote the model to a deployment space and deploy the trained model

Now you can promote the model to a deployment space to deploy the model.

  1. Click the Promote to deployment space.
  2. Choose an existing deployment space. If you don't have a deployment space, you can create a new one:
    1. Provide a space name and optional description.
    2. Select a storage service.
    3. Select a machine learning service.
    4. Click Create.
    5. Click Close.
  3. Click Promote.
  4. When the model is promoted, click the deployment space link in the notification to view the model in your project. Alternatively, you can use the navigation menu to navigate to Deployments, and click the deployment space name.
  5. Next to the model name, click the Deploy icon.
    1. Select Online as the Deployment type.
    2. Specify a name for the deployment.
    3. Click Create.
  6. Click the Deployments tab, and wait for the model to be deployed.
  7. When the deployment is complete, click the deployment name to view the deployment details page.

Task 4: Test the deployed model

Use the deployment to test the model with new data.

  1. Click the Test tab. You can test the deployed model from the deployment details page in two ways: test with a form or test with JSON code.
  2. Click the icon to Provide input data as JSON, then copy the following test data and paste it in the area for the JSON text:

    {"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" ]]
    }]}
    
  3. Click Predict to predict whether a customer with the specified attributes is likely to sign up for a particular kind of account. The resulting prediction indicates that this customer has a high probability of not enrolling in the marketing promotion.

Next steps

Now you can use this data set for further analysis. For example, you or other users can do any of these tasks:

Additional resources