Decision Optimization experiment views and scenarios

The Decision Optimization experiment UI has different views in which you can select data, create models and solve different scenarios and visualize the results.

Note: To create and run Optimization models you must have both a Machine Learning service added to your project and a deployment space associated with your experiment:
  1. Add a Machine Learning service to your project. You can either do this at the project level (see Creating a Watson Machine Learning Service instance), or this can be done when you first create a new Decision Optimization experiment: click Add a service, select or create a New service, click Associate service in the item bar, then close the pane.
  2. Associate a deployment space with your Decision Optimization experiment (see Deployment spaces). A deployment space can be created or selected when you first create a new Decision Optimization experiment: click Create a deployment space, enter a name for your deployment space and click Create. For existing models, you can also create or select a space in the Overview information pane.

When you add a Decision Optimization experiment as an asset in your project, you open the Decision Optimization experiment UI.

The Decision Optimization experiment UI allows you to create and solve prescriptive models. Optimization models allow you to focus on a specific business problem that you want to solve.

You can create a Decision Optimization model from scratch by simply entering a name or from a .zip file and then and selecting Create. Scenario 1 opens.

With the Decision Optimization experiment UI, you can create several scenarios, using different data sets and optimization models. This allows you to create and compare different scenarios and see how big an impact changes can have on a given problem.


The overview tab provides a summary of information about all your scenarios (see Scenario pane for more information about scenarios). This is particularly useful when you have several scenarios, as it gives you model, data and solution information for all your scenarios at a glance. It also shows whether your scenario uses the default environment set for that type of model or if it uses a different environment for that particular scenario. See Selecting a different run environment for a particular scenario for more information. .

From this view you can create a scenario from scratch or from a file, or you can select a scenario and click the three dots to perform the following actions:
  • Create a scenario
  • Duplicate a scenario
  • Rename a scenario
  • Run a scenario
  • Export the scenario as a .zip file
  • Generate a Python notebook from a scenario
  • Save the scenario as a model for deployment (The data types set in the Prepare data view and any run configuration parameters that you might have set for that scenario will also be saved in the deployment)
  • Delete a scenario

In this view when you click the information icon Information pane icon, the information pane opens showing you details about your experiment and the name of your associated deployment space. Here you can create a Machine Learning service and even add this service to your project if you haven't already done so. You can also create or choose a deployment space for your experiment so that you can use a different space for a particular solve. The creation date and name of the experiment creator is also provided here. This is useful if you are sharing an experiment created by another collaborator.

Overview pane showing 2 scenarios and info pane open

The information pane Information pane icon also has an Environment tab. Here you can see the default run environment that is used for the solve when you click Run in the Build model view. The environment will depend on your model type. Modeling Assistant models require Python environments. See Hardware and software configuration.

You can run or delete multiple scenarios from this Overview by selecting them and clicking Run or Delete. These buttons are only visible when a selection is made. If one or more scenarios in your selection cannot be run (for example because no environment has been created) a tooltip provides you with information about why the scenario cannot be run, and the Run button is unavailable. You can also stop a run that you have launched from the Overview pane by clicking the stop button that appears while the scenario is running.

You can also configure this Overview pane by clicking the Settings icon Overview settings icon. This opens a pane where you can select the columns that you want to display in your Overview pane, and change the row height.

Hardware and software configuration

When you use the experiment UI, the necessary environments are created for you automatically. You can, however configure the environment to be used for your solve, by changing the default environment. This environment will then be applied to all scenarios in your experiment. The environment will depend on your model type: Python, OPL, CPLEX, CPO, or Modeling Assistant (which uses Python environments). For example, to change the default Python environment for DOcplex and Modeling Assistant models see Configuring environments and adding Python extensions. This section also shows you how to select a different run environment for a particular scenario, without changing the default for all the other scenarios.

The Decision Optimization environment currently supports Python 3.9. The default version is Python 3.9.

For each of the following views, you can organize your screen as full-screen or as a split-screen. To do this, hover over one of the view tabs (Prepare data, Build model, Explore solution) for a second or two. A menu then appears where you can select Full Screen, Left or Right. For example if you choose Left for the Prepare data view, and then choose Right for the Explore solution view, you can see both these views on the same screen.

Prepare data view

When you create a new Decision Optimization experiment in your project, the Prepare data view opens. In this view you can browse and import data sets, including connected data, that you already have in your Project in Cloud Pak for Data as a Service. You can also choose to add data that you want to add to your project. Click add data and then Browse in the data pane that opens. Browse and select your files and click open to add them. When you add a data set in this way, it appears listed in the Prepare data view as well as in the Data assets listed in your project.

Select the files you want to import to your Scenario and click Import. You can import files in most formats including .csv, .xls, .json files, as well as connected data . If you are using Excel files with multiple sheets, only the first sheet will be imported. You can, however, export each sheet as a .csv file to import your data into your Decision Optimization experiment.

Note: If your .cvs file contains any malicious payload (formulas for example) in an input field, these might be executed.

If you subsequently modify, replace or delete a data set in your Project, or re-upload a new version of a table using the add data button in the Prepare data view, this will have no impact on your scenario unless you choose to import it into your scenario.

Prepare data view showing diet data

When you have imported your data files in to your scenario, the Prepare data view opens automatically. This view allows you to:
  • Rename or delete a table.
  • Edit the data directly in a table. You can scroll the table to see more rows (or Open the table in full mode to see the whole table and edit it in a new window)
  • Rename column names.
  • Re-size columns.
  • Change the data type (number or string) of a column. (These types will be used when you save your scenario as a model for deployment)
  • Add or remove rows.
  • Search and filter table values. See Table search and filtering.
  • Sort tables.

If you re-import a file at any time you can choose to import it with a new name. This can be useful if you want to use different versions of the same data table. You can also choose to update and overwrite the current table in your Scenario. If you choose to re-import and update a table, a notification message will appear to remind you of which tables have been overwritten.

Changes you make in the Prepare data view will be saved in your scenario, but not in the Project Data sets. Similarly if you make changes to the Project Data sets, unless you import these changes into your scenario, they will not appear in the Prepare data view.

You can access your imported data from your Python DOcplex model using the syntax inputs['tablename']. See Input and output data.

Build model view

Run model pane showing Python diet model

This view allows you to formulate or import optimization models and run them.

There are several options to create a model:

  • Create and edit a Python or OPL model in the Decision Optimization experiment UI. See OPL models.
  • Use the Modeling Assistant to formulate models in natural language. See Formulating and running a model: house construction scheduling for a tutorial on formulating models with the Modeling Assistant.
  • Import and edit a Python optimization model from an existing notebook. Use this option to import a notebook from your project. If your notebook is running on a Jupyter customized environment (see Adding a customization), when you import the notebook into the experiment UI, you also import this environment definition. This enables you to make use of additional Python libraries when running models from the experiment UI. This custom software definition will also be used when you deploy your model in Watson Machine Learning (both when saving your model for deployment and when promoting it to your deployment space).
  • Import and edit a Python optimization model from an external file. Use this option to import a Python file from your local machine.
  • Import and edit an OPL model from a file.
  • Import and edit a CPLEX model from a file.
  • Import and edit a CP Optimizer (CPO) model from a file.
  • Import a scenario .zip file (which contains both model and data). This can be a new scenario or one that you have previously exported from the Decision Optimization experiment UI and edited locally.
  • Generate a Python model from your current scenario (Python and Modeling Assistant models only). This will create a Python notebook optimization model in your project.

When you edit your model formulation in the Decision Optimization experiment UI your content is saved automatically and the Last saved time is displayed.

Once you have created a model, the Replace arrow Replace icon (arrow) appears. If you click this Replace arrow, you return to the Model wizard. Note that if you create a new model, the previous one is deleted.

When you have finished editing your model, you can solve it by clicking the Run button in this view.

To run models you must associate a Watson Machine Learning instance with your Cloud Pak for Data as a Service project and associate a deployment space with your Decision Optimization experiment.

When you run a model from the Decision Optimization experiment UI the do_20.1 runtime is used.

You can view and change this CPLEX runtime and your Python environment in the experiment Overview by opening the Environment tab of the Information pane and selecting one of the available environments for your type of model (Python, OPL, CPLEX, CPO). Python is used to run Decision Optimization models formulated in DOcplex in both Decision Optimization experiments and Jupyter notebooks. Modeling Assistant models also use Python because DOcplex code is generated when models are deployed.

You can also set and modify certain optimization parameters by clicking the Configure run icon next to the Run button. These parameters will be then applied each time you click Run.

Multiple model files

You can create a Python, OPL using multiple model files by clicking the + tab next to MODEL and selecting Add new empty or Upload Files... (to add any type of file). The tab named MODEL must always contain your main model. If you try to upload another file with the same name, for example, you are prompted to upload it with new name or replace your main model. You can also replace a model by clicking the Import Import icon icon. See the Multifile example in the Model_Builder folder of the DO-samples.

Run configuration

When you click the Configure run icon Configure run icon next to the Run button in the Build model view, a window opens showing you the currently set parameter values.

Run configuration pane for scenario 1

Here you can select and edit different run configuration parameters. For more details, see Run parameters.

Once you have set the run configuration parameters they will be used with those values for all subsequent runs for that scenario.

You can remove set parameters by hovering over the parameter and clicking the remove button.

The Environment tab in this pane shows you the default run environment that is being used for your experiment. Environment tab of Run Configuration pane for scenario 1

When you solve a model by clicking Run, this default environment is used or, if it doesn't already exist, is created automatically. The type of environment being used will depend on your model type (Python, OPL, CPLEX, CPO, Modeling Assistant). For more details see Environment tab in Overview information pane. You can also configure your environments.

Explore solution view

Explore solution pane showing results for solved diet model

During the run, a graphical display shows the feasible solutions obtained until the optimal solution is found.

When your run completes successfully, the solution is displayed in one or several tables, or as a file for CPLEX and CPO models, in the Explore solution view.

The Results section contains several tabs. The first tab shows the Objectives and KPIs. The Solutions tables tab shows the resulting (best) values for the decision variables. These solution tables are automatically displayed in alphabetic order. Note that these solution tables are not editable but can be filtered. See Table search and filtering. You can download both the objectives and solution tables. For CPLEX and CPO models, the solutions are not provided in tables, but in files that you can download.

You can define output tables to appear in this view in a Python DOcplex model using the syntax outputs['tablename'], see Input and output data.

The Relaxations and Conflicts tabs show if there have been any conflicting constraints or bounds in the model and, if these options have been chosen, which constraints or bounds were relaxed in order to solve the model.

The Engine statistics tab shows you information about the run status (processed, stopped, or failed), graphical information about the solution, and model statistics. You can zoom in on the graph by moving the end points of the horizontal bar above the graph, or by selecting an area in the graph. To restore the original graph after zooming in, you can fully expand the horizontal bar or refresh the page.

Engine statistics tab showing solution for diet model.

The Log tab displays the log file from the CPLEX or CP Optimizer engines which you can also download.

Engine log tab showing log for diet model

For multi-objective models formulated with the Modeling Assistant, the solution table also displays the sliders, weights and scale factors that were set in the model. The combined objective is the sum of all the objective values (positive additions for minimize objectives and negative for maximize objectives) multiplied by the scale factor (1 by default) and the weight factor. The weight factor is 2 to the power of the slider weight minus 1. For example, a slider weight of 5, the weight factor is 25-1= 24= 16. The scaled weighted value is thus the objective function value multiplied by this weight factor.

To run models you must associate a Watson Machine Learning instance with your Cloud Pak for Data as a Service project and associate a deployment space with your Decision Optimization experiment.

Scenario pane

When you create a new Decision Optimization experiment, a scenario is automatically created along with the model. A scenario contains data sets, a model, and a solution.

You can use scenarios to:
  • Make sure a specific model works with a variety of data
  • See how different data sets impact the solution to a given problem
  • See how a model formulation impacts the solution to a given problem
  • Save a model for deployment

Scenario pane showing 2 scenarios with scenario 2 information expanded.

The Scenario pane allows you to easily manage different scenarios of a Decision Optimization experiment.

To open the Scenario pane, click the Open scenario pane button Open scenario pane button.

In this pane, you can:
  • Create new scenarios (create a new scenario from scratch, duplicate your current scenario or import a new scenario from a file).
  • Select the scenario you want to work in.
  • See existing scenarios and their details (input data, model, solution). This can be expanded or collapsed by clicking the arrow next to the scenario.
  • Manage existing scenarios (duplicate, rename, delete).
  • Generate a Python notebook from a scenario.
  • Save the scenario as a model for deployment (The data types set in the Prepare data view and any run configuration parameters that you might have set for that scenario will also be saved in the deployment). See Deploying a Decision Optimization model using the user interface for more details.
  • Export the scenario as a .zip file.

If you click Generate a notebook from a scenario, the notebook is saved as an asset in your project. If you have used multiple files in the Build model view, these files are automatically referenced in the generated notebook so that you can read them from the notebook. The Python version for your generated notebook is Python 3.9, if you have specified this in the Run parameters in the Run configuration. If not specified, Python 3.9 is used by default.

If you click Export as zip file, a scenario.json file is also included in the archive which describes the exported model. If you make changes locally to this scenario (for example you add a table to your model), you can then edit this json file to include these changes and then re-import your scenario and these changes will appear in your scenario.

New scenarios can be imported by choosing From file in the Create Scenario menu and then selecting the .zip file containing your new scenario.

You can also use this method to create a new scenario from a debug .zip file that you have generated (see Custom parameters) and downloaded. The debug .zip file will provide you with a scenario containing data, model, solution and the run configuration parameters.

You can switch scenarios while running a model and see in the scenario pane which scenarios are running or are queued.

Clicking the arrow next to a scenario in this pane also reveals summary information about the data, model and solution.

Your scenario will use the default run environment that has been created for that model type. You can view this default on the Overview Information pane Information pane icon Environment tab. For details, see Hardware and software configuration and Configuring environments. To change the run environment for a particular scenario see Selecting a different run environment for a particular scenario.