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. You can also save your scenarios for deployment from the experiment UI interface.

Note: To create and run Optimization models, you must associate a deployment space with your experiment. This 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.

With the Decision Optimization experiment UI, you can create and solve prescriptive models. Optimization models enable you to focus on the specific business problem that you want to solve.

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

With the Decision Optimization experiment UI, you can create several scenarios, with different data sets and optimization models. Thus you can create and compare different scenarios and see what impact changes can have on a problem.

Overview

The overview tab provides a summary of information about all your scenarios (see Scenario pane for more information about scenarios). This summary is useful when you have several scenarios, as it gives you model, data an impact changed 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. For more information, see Selecting a different run environment for a particular scenario (Decision Optimization).

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 are also 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 information is useful if you are sharing an experiment created by another collaborator.

Overview pane showing 2 scenarios and information 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 depends 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 action opens a pane where you can select the columns that you want to display in your Overview pane.

Hardware and software configuration

When you use the experiment UI, the necessary environments are created for you automatically. However, you can 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 depends 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 (Decision Optimization). It 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.10 and 3.9 (deprecated). The default version is Python 3.9 (deprecated).

For each of the following views, you can organize your screen as full-screen or as a split-screen. To do so, 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. 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 and also in the Data assets listed in your project.

Select the files that you want to import to your Scenario and click Import. You can import files in most formats including .csv, .xls, .json files, and 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 items might be executed.

Subsequently, if you modify, replace or delete a data set in your Project, or re-upload a new version of a table by using the add data button in the Prepare data view, this action will have no impact on your scenario, unless you choose to import the data 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. In this view you can:
  • 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.
  • Resize 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 that you make in the Prepare data view will be saved in your scenario, but not in the Project data sets. Similarly, if you modify 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 by using the syntax inputs['tablename']. See Input and output data.

Build model view

When you click Build model in the sidebar for the first time, a window appears asking you how you want to formulate your model. You can choose to use the assisted mode with the Modeling Assistant, or create or import a model in Python, OPL, LP (CPLEX) or CPO code.Build model view showing Python diet model

In this view you can formulate, or import, optimization models and run them.

You have several options to create a model:

  • Create and edit a Python or OPL model in the Decision Optimization experiment UI. See OPL models (Decision Optimization).
  • 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. Thus you can use additional Python libraries when you run 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).

    If your project has default Git integration, when you choose to create a model from a notebook, a list of all folders that contain .ipynb files located in your assets directory is displayed for you to select from. You must thus ensure that the notebook that you want to import is located in the assets directory in Jupyter Lab. If your chosen notebook folder contains other .py files, when you import your notebook, these files will also be imported into your model as additional files.

  • Import and edit a Python optimization model from an external file. Use this option to import a Python file from your local computer.
  • 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 (constraint programming) from a file.
  • Import a scenario .zip file (that 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 creates a Python notebook optimization model in your project. For Git-integrated projects, the notebook is generated in a subfolder of your asset directory. This notebook is not listed in your project assets, but can be viewed in Jupyter Lab. If your scenario contains other files, in addition to the model, these files will also be exported into the same subfolder as the notebook.

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

When 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.

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 that are 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 MODEL tab must always contain your main model. If you try to upload another file with the same name, for example model.py, 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.

After you 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 exist, it is created automatically. The type of environment being used depends 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 view 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.

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 your problem
  • See how a model formulation impacts the solution to your problem
  • Save the scenario as a model for deployment (any run configuration parameters that you might have set for that scenario are also saved in the deployment). See Deploying a Decision Optimization model by using the user interface for more details.

Scenario pane showing 2 scenarios with scenario 2 information expanded.

From the Scenario pane you can 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 that you want to work in.
  • See existing scenarios and their details (input data, model, solution). Each one 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 are also saved in the deployment). See Deploying a Decision Optimization model by 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. For Git-integrated projects, the notebook is generated in a subfolder of your asset directory. This notebook is not listed in your project assets, but can be viewed in Jupyter Lab. If your scenario contains other files, in addition to the model, these files will also be exported into the same subfolder as the notebook. 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 depends on the environment that you have configured for your scenario, see Configuring environments. If the environment was automatically created for your scenario, the notebook uses the default Python version 3.9 (deprecated).

If you click Export as zip file, a scenario.json file that describes the exported model is also included in the archive. 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. You can then re-import your scenario and these changes appear in your scenario.

New scenarios can be imported by choosing From file in the Create Scenario menu and then selecting the .zip file that contains 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 provides 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 uses 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 (Decision Optimization).