Wasserstein Logistic Regression with Mixed Features

Aras Selvi, Mohammad Reza Belbasi, Martin B Haugh, Wolfram WiesemannNeurIPS 2022

TL;DR

This paper introduces a distributionally robust optimization (DRO) framework for logistic regression capable of handling both numerical and categorical features using the Wasserstein distance. The authors prove that while the problem appears exponentially large, it can be solved in polynomial time. Crucially, this represents a genuinely new variant of logistic regression that cannot be reduced to simple regularization.

The Challenge: Categorical Features in Robust Optimization

Logistic regression is a workhorse of machine learning, but it has two major Achilles' heels: it overfits when data is scarce relative to the number of features, and it is highly sensitive to "distribution shift"—when the data your model sees in the real world looks slightly different from your training set.

To fix this, researchers often use Distributionally Robust Optimization (DRO). Think of DRO as a zero-sum game: you try to build the best model, while a "fictitious adversary" tries to perturb your training data (within a certain budget called a Wasserstein ball) to maximize your loss. By training against this adversary, your model becomes much more resilient.

However, previous Wasserstein DRO models only worked well for numerical features. When you add categorical features (like "City" or "Color"), the adversary's search space becomes discrete and massive. Naive attempts to solve this lead to optimization problems that grow exponentially with the number of categories, making them impossible to solve for real-world datasets.

Methods: A Polynomial-Time Solution

The authors propose a Wasserstein Logistic Regression with Mixed Features, utilizing several key innovations to bypass the exponential explosion of categorical data:

  1. Exponential Conic Formulation: They reformulate the robust problem into an exponential conic program. While this version is technically "finite," it contains an exponential number of constraints—one for every possible combination of categorical features.
  2. Complexity Breakthrough: They prove that for the specific case of the log-loss function (used in logistic regression), the problem is solvable in polynomial time. This is a surprising breakthrough because, for generic loss functions, this specific problem is NP-hard.
  3. Column-and-Constraint Generation: To make the model practically usable, they developed an iterative cutting-plane algorithm. Instead of solving all exponential constraints at once, the algorithm starts with a small subset and uses a clever sub-routine to quickly identify the "most violated" constraint to add in the next step.
  4. Ground Metric Design: They define a specific distance metric that treats numerical differences and categorical discrepancies (mismatches) separately, allowing the model to hedge against realistic perturbations in both types of data.

Key Insights and Ideas

  • Not Just Regularization: In many DRO models, the "robust" version ends up being mathematically identical to standard logistic regression with a penalty term (like Lasso or Ridge). The authors show that for mixed features, this is not the case. Their model is a "genuinely novel variant" that captures nuances standard regularization misses.
  • Avoiding "Nonsensical" Data: A common shortcut in machine learning is to treat categorical data as continuous numbers. The authors demonstrate that this is a mistake in robust optimization; it allows the adversary to create "impossible" data points (e.g., a binary feature becoming a value like 15,312), leading to models that are overly conservative and perform poorly.
Probability assignment showing continuous features generating impossible data points
  • The Power of Log-Loss: The specific mathematical structure of the logistic "log-loss" is what allows an otherwise impossible problem to be solved efficiently. This suggests that the choice of loss function is even more critical in robust optimization than previously thought.

Key Results

The authors evaluated their method using synthetic data (to test scaling) and 14 popular benchmark datasets from the UCI Machine Learning Repository containing purely categorical or mixed features.

  • Computational Efficiency: The proposed column-and-constraint (cutting plane) scheme scales gracefully. While a naive monolithic solver's time explodes exponentially as you add categorical features, this new method remains highly efficient even with many features.
Runtime comparison between monolithic and cutting plane approaches as features increase
  • Superior Accuracy: On the 14 UCI benchmark datasets, the robust model (DRO) outperformed both standard logistic regression and Lasso-regularized regression. Specifically, their method achieved the lowest classification error in 12 out of 14 instances.
  • Statistical Significance: In 7 of the 14 datasets, the improvements were statistically significant, proving that the robust approach provides a real edge in diverse real-world scenarios.

Limitations and Future Work

  • Solver Dependency: The current implementation relies on high-performance commercial solvers (like MOSEK). Developing open-source, tailored solvers specifically for this mixed-feature structure could increase adoption.
  • Generalization to Other Models: The authors note that their column-and-constraint approach is a "template" that could likely be extended to other models like Support Vector Machines (SVMs), linear regression, or even decision trees.
  • Hyperparameter Tuning: Like many robust methods, this model requires tuning the "Wasserstein radius" (the adversary's budget). While cross-validation was successful, finding more automated ways to set this parameter remains an open area for research.

Summary updated

BibTeX
@inproceedings{selvi2022wasserstein,
  author = {Aras Selvi and Mohammad Reza Belbasi and Martin B Haugh and Wolfram Wiesemann},
  title = {{Wasserstein Logistic Regression with Mixed Features}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=U-RsnLYHcKa},
}
Figure