cs.LGMay 29, 2025

DRO: A Python Library for Distributionally Robust Optimization in Machine Learning

Authors: Tianyu Wang, Jiashuo Liu, Henry Lam, Hongseok Namkoong, Jose Blanchet

Abstract

We introduce dro, an open-source Python library for distributionally robust optimization (DRO) for regression and classification problems. The library implements 15 DRO formulations and 9 backbone models, enabling 85 distinct DRO methods. Furthermore, dro is compatible with both scikit-learn and PyTorch through a unified interface, and uses approximation techniques to reduce runtime for some computationally demanding formulations. Comprehensive documentation is available at https://python-dro.org.

Figures & tables

Appendix figures & tables5 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

Dec 29, 2024

Distributionally Robust Optimization via Iterative Algorithms in Continuous Probability Spaces

We study distributionally robust optimization (DRO) for robust inference when the worst-case distribution is continuous, leading to significant computational challenges due to the infinite-dimensional nature of the optimization problem. Unlike traditional discrete DRO approaches, which often suffer from scalability issues, limited generalization, and costly worst-case inference, our framework exploits Brenier's theorem to characterize the least favorable distribution as the pushforward of a transport map from a continuous reference measure. This characterization motivates our study of the minimax problem in Wasserstein space. We propose an iterative algorithmic framework with multiple variants and establish global convergence guarantees under mild assumptions, deriving complexity bounds in terms of subgradient evaluations and inexact Jordan-Kinderlehrer-Otto updates. Numerical results with neural network-based transport maps demonstrate that the proposed method enables both stable training of robust classifiers and effective worst-case inference for classification tasks.
Sep 30, 2026

Distributionally robust linear regression through the lens of adversarial training

Distributionally robust optimization (DRO) studies parameter estimation under uncertainty in the underlying probability distribution and has emerged as a principled framework for analyzing robustness and generalization. In particular, Wasserstein DRO, with distributional uncertainty induced by the Wasserstein distance, generalizes several popular regularizers. This paper studies Wasserstein DRO linear regression, unifying square-root Lasso and adversarial linear regression as important special cases. We prove that many properties of these two special cases carry over to this general method. In particular, we show (i) deterministic and non-asymptotic in-sample error bounds O(n−1/2)O(n^{-1/2}) in general and O(n−1)O(n^{-1}) under design matrix and sparsity conditions; (ii) insensitivity to the noise level, also known as the pivotal property; and (iii) solution equivalences for small and large ambiguity sets. The key proof step is to recast the method into a quadratic form, mimicking adversarial linear regression. We also show that the method can be solved efficiently, and we validate our findings through numerical simulations.
Oct 30, 2026

Regret-Optimal Wasserstein-Robust Linear Regression

Distributionally robust optimization (DRO) minimizes worst-case risk under distributional uncertainty, but its decisions can be suboptimal in terms of their excess risk, or regret. We study this gap for multivariate least-squares regression, assuming that the observed source law and unknown target law differ by an adversarial 2-Wasserstein perturbation of size ε\varepsilon. We first identify the asymptotic complexity of robust decision-making in the ε→0\varepsilon \to 0 limit, characterized by a problem-specific condition number κκ. Here, a wide spectrum of simple algorithms, including DRO, achieve the instance-optimal rate of O(κε2)O(κ\varepsilon^2). For fixed ε>0\varepsilon > 0, we prove that DRO still achieves the minimax rate if the problem has bounded residual effective rank. On the other hand, we identify significant failure modes where DRO is provably suboptimal by dimension-dependent factors. Fortunately, we prove that two alternative procedures, minimax regret optimization (MRO) and spectral-norm regularization (SNR), attain the minimax rate. We derive an exact convex reformulation of MRO and an accelerated proximal algorithm for SNR, along with high-probability finite-sample guarantees. We support these theoretical results with numerical experiments separating the performance of MRO and SNR from DRO.