Best Feature Selection for Forecasting
In this example, we solve a linear regression problem that minimizes the residual sum of squares subject to the constraint that the number of non-zero feature weights should be less than or equal to a given upper limit. We construct a mixed-integer quadratic programming (MIQP) model of this problem, implement this model in the Gurobi Python API, and compute an optimal solution.
This modeling example is at the intermediate level, where we assume that you know Python and are familiar with the Gurobi Python API. In addition, you should have some knowledge about building mathematical optimization models.
Request a Gurobi Evaluation License or Free Academic License
Modeling examples are coded using the Gurobi Python API in Jupyter Notebook. In order to use the Jupyter Notebooks, you must have a Gurobi License. If you do not have a license, you can request an Evaluation License as a Commercial User or download a free license as an Academic User.
Access the Jupyter Notebook Modeling Example
Click on the button below to be directed to the GitHub HTML page, where you can download the repository for the Best Feature Selection for Forecasting Jupyter Notebook modeling example.