About¶
dro 0.4.3 is a Python package for distributionally robust optimization
in supervised learning. It supports linear and kernel models (including SVM,
logistic regression, and linear regression), neural networks, and tree ensembles
with several choices of ambiguity set. It also includes synthetic data
generators, runnable examples, and tools for model evaluation.
The convex linear formulations use cvxpy with CLARABEL by default.
Commercial solvers such as MOSEK are optional. See the
installation guide for solver selection and the
tutorials for formulations and usage.
Without specified, our DRO model is to solve the following optimization problem:
where \(U\) is the so-called ambiguity set and typically of the form \(U = \{P: d(P, \hat P_n) \leq \epsilon\}\) and \(\hat P_n := \frac{1}{n}\sum_{i = 1}^n \delta_{(X_i, Y_i)}\) is the empirical distribution of training samples \(\{(X_i, Y_i)\}_{i = 1}^n\). And \(\epsilon\) is the hyperparameter.
In release 0.4.3, dro supports:
Synthetic data generation¶
Python Module |
Function Name |
Description |
|---|---|---|
|
|
Basic classification task |
|
Following Section 3.1.1 of [1] |
|
|
Following Section 5.1 of [2] |
|
|
Following Section 4.1 (Classification) of [3] |
|
|
|
Basic regression task |
|
Following Section 3.1.2 of [1] |
|
|
Following Section 3.1.3 of [1] |
|
|
Following Section 3.3 of [1] |
|
|
Following Section 4.1 (Regression) of [3] |
Linear DRO models¶
Python Module |
Class Name |
Description |
|---|---|---|
|
|
Base class for linear DRO methods |
|
|
Linear chi-square divergence-based DRO |
|
|
Kullback-Leibler divergence-based DRO |
|
|
CVaR DRO |
|
|
Total Variation DRO |
|
|
Marginal-X CVaR DRO |
|
|
Maximum Mean Discrepancy DRO |
|
|
Y|X (ConditionalShiftBased) CVaR DRO |
|
|
Holistic Robust DRO on linear models |
|
|
Wasserstein DRO |
|
Robust satisficing version of Wasserstein DRO |
|
|
|
Sinkhorn DRO on linear models |
|
|
Optimal Transport DRO with Conditional Moment Constraints |
|
|
Outlier-Robust Wasserstein DRO |
|
|
Linear Group DRO minimizing the worst empirical group loss |
NN DRO models¶
Python Module |
Class Name |
Description |
|---|---|---|
|
|
Base model for neural-network-based DRO |
|
|
Chi-square Divergence-based Neural DRO Model |
|
|
Wasserstein Neural DRO with Adversarial Robustness |
|
|
Holistic Robust NN DRO |
|
|
Sinkhorn DRO for neural networks |
|
|
Neural Group DRO with adversarial group reweighting |
Tree-Ensembles DRO models¶
Python Module |
Class Name |
Description |
|---|---|---|
|
|
KL-DRO for XGBoost |
|
|
CVaR-DRO for XGBoost |
|
|
Chi2-DRO for XGBoost |
|
|
KL-DRO for Light GBM |
|
|
CVaR-DRO for Light GBM |
|
|
Chi2-DRO for Light GBM |
References¶
[1] John C. Duchi and Hongseok Namkoong. Learning Models with Uniform Performance via Distributionally Robust Optimization. The Annals of Statistics, 49(3):1378–1406, 2021. Institute of Mathematical Statistics.
[2] Aman Sinha, Hongseok Namkoong, and John C. Duchi. Certifying Some Distributional Robustness with Principled Adversarial Training. International Conference on Learning Representations (ICLR), 2018. OpenReview.net.
[3] Jiashuo Liu, Jiayun Wu, Bo Li, and Peng Cui. Distributionally Robust Optimization with Data Geometry. Advances in Neural Information Processing Systems, 35:33689–33701, 2022. Curran Associates, Inc.