Decision Optimization Generally Available in Watson Studio Notebooks

AlainChabrier
4 min readAug 7, 2019

--

This post discusses some technical considerations as the support for Decision Optimization in Watson Studio Notebooks is now Generally Available.

We have recently announced the General Availability of the support of Decision Optimization (CPLEX) in the Python notebooks of Watson Studio Cloud. This functionality has been in beta for some months and you can read an introductory blog post on what you can do with it.

Going GA means that we have made some changes, and here is a summary of what you need to know to continue to use Decision Optimization (DO) in Watson Studio (WS) Python notebooks.

Developing Decision Optimization models in Python Notebooks

There are several different ways to develop Decision Optimization models, and Python Notebooks have a few benefits I would like to highlight.

Python is a general purpose language (GPL) so while it may sometimes appear more complex for specific optimization modeling than a dedicated language like OPL, it also allows to do other things than just optimization. Many packages are available in Python for different tasks, from data manipulation and transformation (e.g. pandas) to data and solution visualization (e.g. brunel).

In particular, you have access to Machine Learning packages and your notebook can combine ML and DO together as shown in some of our notebook examples.

The general purpose language will also be a benefit when you want to use decomposition techniques, and solve your business problem by solving several combined optimization models. Among other techniques involving the use of multiple models, let’s mention Lagrangian relaxation, Benders decomposition or column generation.

On the other hand, modeling languages like OPL have plenty of other advantages, see this post for some comparisons of the two approaches.

Environment names

The first important thing to know are the names for the environments. The ‘Default Python 3.5 XS + beta of DO’ environment is obviously not available anymore, and instead the one you must use is ‘Default Python 3.6 XS + DO’.

See below a list of all currently available environments.

Available environments

This environment includes all you need to run CPLEX models using the docplex API.

Note that we have also upgraded our environment to use Python 3.6 now that Python 3.5 is now deprecated in Watson Studio.

This environment includes the full CPLEX commercial edition allowing to solve all types and sizes of models supported by CPLEX.

As before, you can still use the limited CPLEX community edition which is preinstalled in all Python environments, including the free environment.

You can easily change from one environment definition to another through the notebook information panel, under the ‘Environment’ tab. This means that you can formulate optimization models and test them solving small data sets in a given environment, and then to solve bigger data sets, you can just switch environments , without having to rewrite or copy the notebook code.

Information pane for notebook

CPLEX Community vs Commercial Editions

As a reminder, with the Community Edition you can solve problems with up to 1000 constraints and 1000 variables, or with a search space of 1000 X 1000 for Constraint Programming problems.

Other environment definitions

For larger problems, you might need more capacity than is provided in the default DO environment (2 vCPU and 8 GB RAM). For this, you can easily create a new Environment Definition. From your project, go to ‘Environments’ and click the ‘new environment definition’ button. Give your new environment definition a name, select the software version including DO, and the hardware configuration you need.

Pricing

The use of these environments is now priced based on CUH (Compute Unit Hours) calculated by multiplying the duration the environment is active with a multiplier depending on the environment type.

Remember that all plans come with monthly CUH amounts, including the free Lite plan which comes with 50 CUH.

Environments become inactive after a timeout of 1 to 3 hours depending on your plan. So you might prefer to stop them manually in the Environment section of your project before they timeout.

Examples to start

If you don’t know how to start, you can look at the example notebooks using DO that are included in Watson Studio Community.

Some examples are illustrating real use cases such as Finding Optimal Locations for New Stores, some others are illustrating some advanced techniques such as Benders decomposition with decision optimization and some are even showing how to combine ML and DO such as Promoting financial products to bank customers.

Documentation

Apart from product documentation, you might be interested in the following tutorials notebooks to understand more about the different DO techniques.

Also, you can read the full docplex python package documentation.

Alain.chabrier@ibm.com

@AlainChabrier

https://www.linkedin.com/in/alain-chabrier-5430656/

--

--

AlainChabrier

Former Decision Optimization Senior Technical Staff Member at IBM Opinions are my own and I do not work for any company anymore.