Combining machine learning and mathematical optimization integration using Python

Article one of five

Python is a widely used high-level programming language for general-purpose programming, it is designed to be straightforward to implement. Apart from being open source programming language, Python is a great object-oriented, interpreted, and interactive programming language. It combines remarkable power with noticeably clear syntax. There are modules, classes, exceptions, very high-level dynamic data types, and dynamic typing. Python is also usable as an extension language for applications written in other languages that need easy-to-use scripting or automation interfaces.

When it comes to data science, Python is the language that is most easily understood and learned by professions such as mathematicians or economists. It is widely considered as the preferred language for teaching and learning ML (Machine Learning). SciPy, for example, is a Python-based ecosystem of open-source software for mathematics, science, and engineering. SciPy uses various packages like NumPy, IPython or Pandas to provide libraries for common math- and science-oriented programming tasks. This makes it a great option when you want to manipulate numbers and display or publish the results. It is also free.

During the last few years researchers have written interfaces to connect mathematical optimization (MOPT) solvers to Python. Pyomo is a Python-based open-source software package that supports a diverse set of optimization capabilities for formulating, solving, and analyzing optimization models. A core capability of Pyomo is modeling structured optimization applications. It can be used to define general symbolic problems, create specific problem instances, and solve these instances using commercial and open-source solvers. There is a wide range support for problem types, including: Linear programming, Quadratic programming, Nonlinear programming, Mixed-integer linear programming, Mixed-integer quadratic programming, Mixed-integer nonlinear programming, Stochastic programming, Generalized disjunctive programming, Differential algebraic equations, Bilevel programming, Mathematical programs with equilibrium constraints, Pyomo also supports iterative analysis and scripting capabilities within a full-featured programming language. Further still, Pyomo has also proven an effective framework for developing high-level optimization and analysis tools.

Another package is PuLP, an LP modeler written in Python. PuLP can generate MPS or LP files and call GLPK, COIN CLP/CBC, CPLEX, and other solvers to solve linear problems.

It is now especially important that a new package must be created to combine ML and MOPT for Python, there are many variants, here’s 4 scenarios to consider:

  • Scenario A. The output of ML is input to MOPT
  • Scenario B. The output MOPT is input to ML
  • Scenario C. MOPT can be used as an algorithm to ML classifiers or general-purpose ML algorithms
  • Scenario D. ML can be used to help MOPT solvers to perform better not only for finding solutions faster but for finding more good solutions or identifying structure in MOPT problems

We will discuss these four scenarios in our follow-ups to this article.

› Next Article