work: installing DOcplex
On this snowy (fingers crossed), slow Friday at work, I set myself a simple project. Get DOcplex up and running on our home computer, a Mac.
First, what is DOcplex? IBMยฎ Decision Optimization CPLEXยฎ modeling for Python (aka DOcplex) makes it possible to model optimization problems using Python. Once a problem is modeled in Python, there are options for solving the optimization problems, locally and on the cloud. Modeling optimization problems in Python opens up the possibility of using the multitude of helpful and engaging Python tools and libraries, including Jupyter notebooks, pandas, geopy and on and on.
In this post, I describe my experiences in installing Anaconda (a Python platform) and DOcplex. In future posts, I will describe installing and connecting to the optimization engines as well as using DOcplex in Jupyter notebooks.
Installing Anaconda:
According to the Continuum Analytics website, “Anaconda is the leading open data science platform powered by Python.”
1. Download the Python 3.5 Graphical Installer for Anaconda 4.2.0 on OSX from https://www.continuum.io/downloads.
2. Install. I had issues when using the default installation path, so I changed from the default directory to my personal Applications directory.
Installing DOcplex:
1. Installing DOcplex is simple once Anaconda is installed; in a Terminal window, type:
pip install docplex
2. In addition to installing the DOcplex package, install the DOcplex examples and documentation from GitHub.
Download the zip files from https://github.com/IBMDecisionOptimization/docplex-examples and https://github.com/IBMDecisionOptimization/docplex-doc.
3. I created the directory DOcplex in my user directory and unzipped these two downloads there.
Once DOcplex is installed, it is possible to model optimization problems. In order to SOLVE the problems, you either need a trial account on Decision Optimization on Cloud or to install the IBM ILOG CPLEX Optimization Studio Community Edition. I will discuss this in future posts: solving a DOcplex model using a local solver and solving a DOcplex model on the cloud. ONce the solvers are setup, you can model problems using DOcplex and solve them from a Jupyter notebook.
GBK Gwyneth
Leave a Reply