From Decision Optimization models to Business applications: Covid-19 examples.

AlainChabrier
8 min readMay 25, 2020

Building highly sophisticated CPLEX optimal models has no value if it does not help business users to take smart decisions.

In previous posts, I shared some basic prototypes on how Decision Optimization (DO) could be used to optimize the transfer of patients between areas or to optimize the mask supply chain.

The two prototypes are covering the following business cases:

These are predictive and optimization models and prototypes, using some real and some fake data, and in particular taking into account invented initial constraints and objectives. This is standard in Decision Optimization models development: you start with the data that is available and some constraints and objective you imagine to create a first prototype.

In this post, I will comment about the necessary additional steps to build a successful application for the business user.

The required next steps are:

  1. complete the model development, debug and tune it, and validate it with a subject matter expert,
  2. create a business application prototype that can be interactively tested by a business user to give more feedback,
  3. embed the model into a professional planning user interface such as Planning Analytics,
  4. enable business user to interact with the model and build trust and enable some feedback loop to allow him to provide additional business knowledge.

Model debugging and validation

In the initial two posts, I show how I have started quick prototypes using notebooks as this is a very easy way to sketch a model, with simple inputs and outputs, and, in these case, also to integrate with some Machine Learning models.

After a first prototype model is created, typical DO model development process requires to investigate different model formulations with different constraints and objectives involved, or with different formulations of the same constraints and see how they impact the solution. It is also very useful to have the ability to display solution in charts and tables as there is no automatic validation of models as in ML.

For that, Decision Optimization in Watson Studio includes a dedicated model builder where you can import the notebook and then experiment with different scenarios, displaying and comparing the different solutions using visualizations.

Importing and exporting notebook to/from the model builder

Note that you can easily import your prototype notebook from the model builder using the Create from notebook option. All cells marked with #dd-ignore will be ignored and not included in the imported model. This is useful as in the notebook you might want to use some code to import data from your project or do some predictions and visualizations with some other packages which will not be part of the optimization model.

Note that, at any time, you can also reexport the model from one of the model builder scenarios into a notebook.

Using Scenarios and Visualizations

You can see in the screenshot below how the model builder with a few scenarios would look like for the mask prototype. Some scenarios have been created where some of the warehouses have been made zero capacity and run so that we can experiment what would be the impact in terms of KPIs.

Compare KPIs and stock over different scenarios

At the end of this step, you have been able to tune your model, include all the constraints and/or objectives which your SME has identified as missing. Your model is now assumed to be valid for being used by Business Users.

As a summary, in this step, you will:

  • debug the optimization model, checking the constraints and objectives are correct using different data sets,
  • tune the optimization model, validating its behavior with bigger production data sets or with alternative formulations for some of the constraints,
  • validate the optimization model, with a SME confirming from the visualizations of outcomes that the solutions are correct.

Look at this post for more details on what you can do with the model builder.

Prototype Business Application

The next step is then to make this model available for a Business User to play with it and provide additional comments. With Decision Optimization for Watson Machine Learning, you can easily deploy your model and make it available as a service. But this is not enough. You also need to deploy it as a prototype application with some support for the decision flow.

Example with the mask prototype

You can do this with the do-ws-js framework which in most cases will allow to create an application prototype without any coding.

Prototype mask application done with do-ws-js

Import any Watson Studio project

You can connect to your Watson Studio project (providing your credentials) and import the data, model and visualizations as a starting point for an application. This application is available outside of Watson Studio so that a business person can play with it, create new scenarios, modify data, run it and see the outcome.

Start from scratch and import your Watson Studio project.

This step will allow a business user to provide feedback on the complete decision cycle; not only on the optimization model but also on how the input data is organized and the solution can be consumed.

Example of widgets and interactions requiring prototyping

As a summary, in this step, you will:

  • create a prototype of business application to let business users start interacting with the model
  • validate the data schema and interactions required both for input data and solutions,
  • design the different graphical widgets and interactions required to make most benefit of the optimization model.

There is no post on do-ws-js framework for prototyping applications yet, but you can look at this part of the do-ws-pa github for a ready to use example code.

Production planning user interface

The next step is to create a real business user application. While one can create a full custom solution, it is possible and easier to integrate the optimization capability into something like Planning Analytics.

Planning Analytics offers all the support required for a business user to create alternative scenarios, browse them in different widgets, and decide. With the addition of Decision Optimization these alternative scenarios can easily be solved to optimality and compared to the alternative ones in Planning Analytics Workspace. This what-if analysis process is very standard with Decision Optimization based strategic applications.

The mask application in Planning Analytics

Such integration between Planning Analytics and Decision Optimization is quite easy to set up, in particular using the do-ws-pa framework, which will enable the integration in most case without any coding.

As a summary, in this step, you will:

  • create the real data warehouse for production use (TM1),
  • create the real user front end for production use (Planning Analytics Workspace),
  • set up the adequate layout and widgets for the business user to best benefits from the decision optimization model as part of the wider decision process.

You can refer to this previous post to read more about the Planning Analytics and Decision Optimization integration benefits.

Business user interactions with the optimization model

The last step is to involve the Business user in the optimization model refinement loop. Indeed, even after several development cycles between the Optimization expert, the Business analyst and the IT developer, the final application may still appear to be too rigid to the final Business user. The optimization model, even with the inclusion of parameters to control some of the constraints and objectives, might appear unclear to him. He will want to understand better what is taken into account, or not, in the optimization model, and he may want to do some small changes which have not been considered.

To this end, we have developed a technology called Cognitive Optimization which is embedded into the Decision Optimization modeling assistant.

You can see below how the mask optimization model could be verbalized to a business user using the modeling assistant (in this case with a custom domain created by Xavier Ceugniet)

Mask model in the modeling assistant

The modeling assistant enables natural language interactions with the optimization model. This allows individuals not familiar with mathematical optimization to have some understanding of the constraints and objectives included in the model. They can also, through a query mechanism, search for additional constraints or objectives to be added to the model.

Providing access to the modeling assistant to a business user is a simple way to build the trust that is required for production usage of AI. It is also a way to have the business user capture additional knowledge which may have been missed in the initial model development.

The natural language used in the modeling assistant may also help to understand model outcome and infeasibility, as described in this post. Business user, interacting with the modeling assistant, can get verbalizations of why the proposed solution is optimal, or why there is no solution with a given set of constraints or data.

Modeling assistant is one of the three modeling methods available in the Decision Optimization for Watson Studio model builder, along with Python docplex and OPL.

As a summary, in this step, you will:

  • provide transparency to your business user about what exactly is included and taken into account in the optimization model,
  • help your business user understand solutions optimality and/or infeasibility,
  • create trust from your business user that the model is complete,
  • let your business user give feedback on your model, providing additional constraints based on his knowledge which could be added to the model.

You can refer to this documentation section about the modelling assistant functionality-

Conclusions

In this post, I tried to illustrate how the AI lifecycle does not end with model prototyping, but that additional steps are required to deliver AI based applications successfully. I also introduced some tools available to support these steps:

  • the DO model builder to complete model development, tuning and validation,
  • the do-ws-js framework to easily create application prototypes,
  • the do-ws-pa integration into Planning Analytics,
  • the modeling assistant for business user interactions with the optimization model.

Alain.chabrier@ibm.com

--

--

AlainChabrier

Decision Optimization Senior Technical Staff Member at IBM Alain.chabrier@ibm.com Opinions are my own and do not express the views of my employer.