SmartPredictThenOptimize
Code for the paper "Smart 'Predict, then Optimize'"
Install / Use
/learn @paulgrigas/SmartPredictThenOptimizeREADME
SmartPredictThenOptimize
Code for the paper "Smart 'Predict, then Optimize'" by Adam Elmachtoub and Paul Grigas.
The code will run on Julia v1.5.0 and requires several packages as listed in the headers of various files.
This code is helpful for replicating the experiments in the above paper. For training your own models on your own data using SPO+, it is recommended to use the excellent PyEPO package by Bo Tang and Elias B. Khalil.
Overview
The code is divided into several folders:
solvercontains all of the files needed to run the SPO+ (SGD and reformulation approaches), random forests, least squares, and least absolute loss methods.oraclescontains examples of optimization oracles such as shortest path and portfolio optimization.testscontains some basic sanity check tests.experimentscontains files concerning the experiments in the paper.plotscontains R code for constructing the plots in the paper.
The solver folder contains the files reformulation.jl and sgd.jl for training a model with the SPO+ loss function using a fixed value of the regularization parameter. To actually a train a model in practice, it is recommended to use the file validation_set.jl and the corresponding function is validation_set_alg, which additionally performs cross-validation using the validation set approach. The documentation in the file explains the syntax for calling the validation_set_alg function.
The files in the folder experiments can simply be run to replicate the experiments included in the paper.
Related Skills
node-connect
337.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
337.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.2kCommit, push, and open a PR
