Skip to main content

Inverse Optimization with Python

Project description

InvOpt: Inverse Optimization in Python

InvOpt is a Python package for solving Inverse Optimization (IO) problems. In IO problems, our goal is to model the behavior of an expert agent, which given an exogenous signal, returns a response action. The underlying assumption of IO is that to compute its response, the expert agent solves an optimization problem parametric in the exogenous signal. We assume to know the constraints imposed on the expert, but not its cost function. Therefore, our goal is to model the cost function being optimized by the expert, using examples of exogenous signals and corresponding expert response actions. More concretely, given a dataset $\mathcal{D} = {(\hat{s}_i, \hat{x}i)}{i=1}^N$ of exogenous signals $\hat{s}_i$ and the respective expert's response $\hat{x}i$, our goal is to find a cost vector $\theta \in \mathbb{R}^p$ such that the Forward Optimization Problem (FOP) with feature mapping $\phi$ $$ x_i \in \arg\min{x \in \mathbb{X}(\hat{s}_i)} \ \theta^\top \phi(\hat{s}_i,x) $$reproduces (or in some sense approximates) the expert's action $\hat{x}_i$. For a more detailed description of the IO problem and its modelling, please refer to Zattoni Scroccaro et al. (2023) and the references therein.

Installation

pip install invopt

InvOpt depends on NumPy. Moreover, some of its functions also depend on gurobipy or cvxpy. You can get a free academic license for Gurobi here.

Usage & examples

The folder examples contains descriptions of the functions available in the InvOpt package, as well as multiple examples.

Contributing

Contributions, pull requests and suggestions are very much welcome. The TODO file contains a number of ideas to possibly improve the InvOpt package.

Citing

If you use InvOpt for research, please cite our accompanying paper:

@article{zattoniscroccaro2023learning,
  title={Learning in Inverse Optimization: Incenter Cost, Augmented Suboptimality Loss, and Algorithm},
  author={Zattoni Scroccaro, Pedro and Atasoy, Bilge and Mohajerin Esfahani, Peyman},
  journal={arXiv preprint arXiv:0000.00000},
  year={2023}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

invopt-0.0.2.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

invopt-0.0.2-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file invopt-0.0.2.tar.gz.

File metadata

  • Download URL: invopt-0.0.2.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for invopt-0.0.2.tar.gz
Algorithm Hash digest
SHA256 fc7bfcf198aedf93fac93f020346199242d1c01263657cacc6b6fd4715d61feb
MD5 2796855da8aef396ec5003e61734997f
BLAKE2b-256 d8abd0e6795730bf887dd07ff308a3da87f2cea8c96589cf74a96ab91c0f3de1

See more details on using hashes here.

File details

Details for the file invopt-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: invopt-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for invopt-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cafca60df2522e8e3a9459bec805a200655d4eb6e24631ffe306d3037522d012
MD5 5c44579be722089f03081f26d0d9f1af
BLAKE2b-256 d5df469a80aa77ef44e5345951f2e787007f07afe5add10b2afdd3c2b8df21b7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page