InvOpt is an open-source 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 an exogenous signal. We assume to know the constraints imposed on the expert, but not its cost function. Therefore, using examples of exogenous signals and corresponding expert response actions, our goal is to model the cost function being optimized by the expert. More concretely, given a dataset
reproduces (or in some sense approximates) the expert's action
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.
The following functions are available in the InvOpt package:
discrete_consistent
: for FOPs with discrete decision spaces (e.g., binary), and when the dataset is consistent with some cost vector. Can be used to check if the data is consistent.discrete
: for FOPs with dicrete decision spaces (e.g., binary).continuous_linear
: for continuous, linear FOPs.continuous_quadratic
: for continuous, quadratic FOPs.mixed_integer_linear
: for FOPs with mixed-integer decision spaces and cost functions linear w.r.t. the continuous part of the decision variable.mixed_integer_quadratic
: for FOPs with mixed-integer decision spaces and cost functions quadratic w.r.t. the continuous part of the decision variable.FOM
: for general FOPs. Solves IO problem approximately using first-order methods.
Contributions, pull requests and suggestions are very much welcome. The TODO file contains some ideas to possibly improve the InvOpt package.
If you use InvOpt for research, please cite our accompanying paper:
@article{zattoniscroccaro2024learning,
title={Learning in Inverse Optimization: Incenter Cost, Augmented Suboptimality Loss, and Algorithms},
author={Zattoni Scroccaro, Pedro and Atasoy, Bilge and Mohajerin Esfahani, Peyman},
journal={Operations Research},
year={2024}
}