0 / 0
Quick start: Build, run, and deploy a Decision Optimization model
Quick start: Build, run, and deploy a Decision Optimization model

Quick start: Build, run, and deploy a Decision Optimization model

You can use the Decision Optimization tool to build Decision Optimization models to decide on the best approach for solving business problems based on sets of data. Read about the Decision Optimization tool, then watch a video and take a tutorial that’s suitable for users with some knowledge of prescriptive analytics, but does not require coding.

Required services Watson Studio 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 a Decision Optimization Experiment to the project. You can add compressed files or data from sample files.
  3. Associate a Watson Machine Learning Service with the project.
  4. Create a deployment space to associate with the project's Watson Machine Learning Service.
  5. Review the data, model objectives, and constraints in the Modeling Assistant.
  6. Run one or more scenarios to test your model and review the results.
  7. Deploy your model.

Read about Decision Optimization

Decision Optimization can analyze data and create an optimization model (with the Modeling Assistant) based on a business problem. First, an optimization model is derived by converting a business problem into a mathematical formulation that can be understood by the optimization engine. The formulation consists of objectives and constraints that define the model that the final decision is based on. The model, together with your input data, forms a scenario. The optimization engine solves the scenario by applying the objectives and constraints to limit millions of possibilities and provides the best solution. This solution satisfies the model formulation or relaxes certain constraints if the model is infeasible. You can test scenarios using different data, or by modifying the objectives and constraints and re-running them and viewing solutions. Once satisfied you can deploy your model.

Read more about Decision Optimization

Watch a video about creating a Decision Optimization model

Watch Video Watch this video to see how to run a sample Decision Optimization experiment to create, solve, and deploy a model by using the Decision Optimization Experiment Builder with Watson Studio and Watson Machine Learning.

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

Try a tutorial to create a model that uses Decision Optimization

In this tutorial, you will complete these tasks:

  1. Create a project.
  2. Create a Decision Optimization experiment in the project.
  3. Build a model and visualize a scenario result.
  4. Change model objectives and constraints.
  5. Deploy the model.
  6. Test the model.

This tutorial will take approximately 30 minutes to complete.

Task 1: Create a project

You need a project to store the Decision Optimization 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 Create an empty project.
  3. Enter a name and optional description for the project.
  4. Choose an existing object storage service instance or create a new one.
  5. Click Create.
  6. When the project opens, click the Manage tab.
  7. On the Services and integrations page, click Associate service > Watson.
  8. If you don't yet have a Watson Machine Learning service instance provisioned, click New service, select Machine Learning, and click Create.
  9. Select your Watson Machine Learning instance, and click Associate service.
  10. Close the Associate service dialog box.

For more information or to watch a video, see Creating a project.
For more information on associated services, see Adding associated services.

Task 2: Create a Decision Optimization experiment

Create the experiment.

  1. From your new project, click New asset > Decision Optimization experiment.
  2. Select Local file.
  3. Click Get sample files to download the house construction sample files to your computer for this tutorial.
  4. Click Browse, and select the HouseConstructionScheduling.zip file from your computer.
  5. Choose a deployment space to associate with this experiment. If you do not have an existing deployment space, create one:

    1. In the Deployment space section, select New Deployment space.
    2. In the Name field, type House sample to provide a name to the deployment space.

    3. Select a storage service to use for the deployment space.

    4. Click Create.

    5. When the space is ready, and click Close to return to the New Decision Optimization experiment screen.
  6. Now click Create to open the Decision Optimization Experiment user interface.

Task 3: Build a model and visualize a scenario result

Build a model and visualize the result using the Decision Optimization Modeling Assistant.

  1. In the left pane, select Build model to open the Modeling Assistant.
  2. Click Run to run the scenario to solve the model and wait for the run to complete.
  3. When the run completes, the Explore solution view displays. Under the Results tab, click Solutions to see the resulting (best) values for the decision variables. These solution tables are displayed in alphabetical order by default.
  4. In the left pane, select Visualization.
  5. Under the Solutions tab, select Gantt to view the scenario with the optimal schedule.

Task 4: Change model objectives and constraints

Next, change the model objectives and constraints.

  1. Click Build model.
  2. In the left pane, click the three-dot icon next to Scenario 1, and select Duplicate.
  3. For the name, type Scenario 2, and click Create.
  4. For Scenario 2, add an objective to the model to optimize the quality of work based on the expertise of each contractor.
    1. Click inside the Type here to find other suggestions search field, type overall quality, and press Enter.
    2. Expand the Objective section.
    3. Click Maximize overall quality of Subcontractor-Activity assignments according to table of assignment values to add it as an objective. This new objective is now listed under the Objectives section along with the Minimize time to complete all Activities objective.
    4. For the objective that you just added, click table of assignment values, and select Expertise. A list of Expertise parameters displays.
    5. From this list, click definition to change the field that defines contractor expertise, and select Skill Level.
  5. Click Run to run the scenario to build the model and wait for the run to complete.
  6. Click Overview to compare statistics between Scenario 1 and Scenario 2.

Task 5: Deploy the model

Next, promote the model to a deployment space, and create a deployment.

  1. From the Overview, click the three-dot menu icon next to Scenario 1, and select Save for deployment.
  2. In the Model name field, type House Construction, and click Save.
  3. After the model is successfully saved, a notification bar displays with a link to the model. Click View in project.
  4. On the Assets tab in the project, select the House Construction model in the Models section.
    1. Click Promote to space.
    2. For the Target space, select House from the list.
    3. Click Promote.
  5. After the model is successfully promoted, a notification displays with a link to the deployment space. Click deployment space. The House sample deployment space displays.
  6. To test the model with a scenario, you must upload data files from your computer to the Assets tab. Click Add to space, then select Data.
    1. In the HouseConstructionScheduling.zip file on your computer, you will find several CSV files in the .containers > Scenario 1 folder.
    2. Drag the Subcontractor.csv, Activity.csv, and Expertise.csv files into the Drop files here or browse for files to upload area in the Data panel.
  7. In the Models section, select the House Construction model to view the model information.
  8. Click New deployment.
    1. For the deployment name, type House deployment.
    2. For the Hardware definition, select 2 CPU and 8 GB RAM from the list.
    3. Click Create.

Task 6: Test a model

Lastly, test the model by creating a job using the CSV files that you previously uploaded to the deployment space.

  1. Click New job.
  2. For the job name, type House job 1.
  3. Click Next.
  4. Select the default values on the Configure page, and click Next.
  5. Select the default values on the Schedule page, and click Next.
  6. Select the default values on the Notify page, and click Next.
  7. On the Choose data page, in the Input section, select the corresponding data assets that you previously loaded into your space for each input ID.
    1. For Input ID Subcontractor.csv, click Select data source > Data asset > Subcontractor.csv > Confirm.
    2. For Input ID Activity.csv, click Select data source > Data asset > Activity.csv > Confirm.
    3. For Input ID Expertise.csv, click Select data source > Data asset > Expertise.csv > Confirm.
  8. In the Output section, you will provide the name for each solution table to be created.

    1. For Output ID ScheduledActivities.csv, click Select data source > Create new, type ScheduledActivities.csv for the name, and click Confirm.
    2. For Output ID NotScheduledActivities.csv, click Select data source > Create new, type NotScheduledActivities.csv for the name, and click Confirm.
    3. For Output ID stats.csv, click Select data source > Create new, type stats.csv for the name, and click Confirm.
    4. For Output ID kpis.csv, click Select data source > Create new, type kpis.csv for the name, and click Confirm.
    5. For Output ID solution.json, click Select data source > Create new, type solution.json for the name, and click Confirm.
  9. Review the information on the Choose data page, and then click Next.

  10. Review the information on the Review and create page, and then click Create.
  11. From the House deployment model page, click the job that you created named House job 1 to see its status.
  12. After the job run completes, click House to return to the deployment space.
  13. On the Assets tab, you will see the five output files:
    • ScheduledActivities.csv
    • NotScheduledactivities.csv
    • stats.csv
    • kpis.csv
    • solution.json
  14. For each of these assets, click the Download icon, and then view each of these files.

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

Parent topic: Getting started with building, deploying, and trusting models