Building Bridges between Regression, Clustering, and Classification

Lawrence Stewart, Francis R. Bach, Quentin BerthetarXiv 2025 · DOI

TL;DR

This paper proposes a novel framework for improving regression tasks by reframing them as a combination of classification and clustering. By using a learned "target encoder" to map continuous targets to probability distributions and a "decoder" to reconstruct the original target, the authors achieve significant performance gains over traditional regression methods across various real-world datasets.

What Problem Does This Paper Address?

Regression, a fundamental machine learning task, often suffers from suboptimal performance when trained with standard mean-squared error minimization, especially with neural networks. This is partly due to the implicit biases of these models, which can lead to convergence to spurious minima or overly smooth solutions. While discretizing regression problems into classification tasks (e.g., by "binning" the target space) has shown promise, it can lead to excessive quantization and inefficient training. This paper addresses the challenge of bridging the gap between regression and classification to achieve better regression performance without the drawbacks of hard binning.

Methods

The core of the proposed method lies in a target encoder-decoder architecture.

  • Target Encoder ($\psi_\omega$): This component maps a continuous target $y \in \mathbb{R}^m$ to a probability distribution over $k$ classes, residing in the simplex $\Delta_k$. This is a departure from hard binning, which assigns a single one-hot vector. The encoder can be learned from data, either in an unsupervised manner or jointly with the rest of the model.
  • Classification Model ($\pi_\theta$): A standard classification model (e.g., a neural network outputting logits) is trained to predict the distribution generated by the target encoder. The loss function used here is typically the Kullback-Leibler (KL) divergence between the predicted distribution and the encoded target distribution.
  • Decoder ($\mu$): This component takes the predicted probability distribution from the classification model and reconstructs a continuous prediction in the original target space $\mathbb{R}^m$. The paper explores both fixed and learned decoders, with a linear decoder being a common choice.

The authors propose several ways to train this framework:

  1. Hard-binning-encoder classification: A baseline where the encoder maps to one-hot vectors (traditional binning).
  2. Soft-binning-encoder classification: Uses a hand-picked, smooth target encoder that approximates one-hot binning.
  3. Pre-trained encoder classification: The encoder-decoder pair is first trained in an unsupervised auto-encoding fashion, and then the frozen encoder is used to generate soft labels for classification training.
  4. End-to-end joint encoder classification: This is the most comprehensive approach, where the encoder, decoder, and classification model are all trained jointly by minimizing a combined loss function that includes auto-encoding, KL divergence, and a regression loss.

Datasets

The paper evaluates its methodology on a diverse set of real-world regression datasets, including:

  • OpenML: Ailerons (AE), Elevators (EL), Computer Activity (CA), Diamonds (DM).
  • UCI: Wine Quality (WN), Bike Sharing (BS), Superconductivity (SC).
  • Medical MNIST benchmark: Retina MNIST (RM).

These datasets span various domains like engineering, social sciences, medicine, and physics. The authors also mention that for tabular data, min-max scaling was applied, and for images, standardization across channels was used, with all labels scaled to [0, 1].

Key Insights and Ideas

  • Soft Binning is Superior: Mapping continuous targets to probability distributions (soft binning) via a learned encoder consistently outperforms hard binning (one-hot encoding) in regression tasks. This suggests that preserving some notion of uncertainty or distribution is beneficial.
  • Bridging the Gap: The encoder-decoder framework naturally bridges regression and classification by allowing the model to learn a representation of the target space that is amenable to classification-style training.
  • Implicit Bias Mitigation: Reframing regression as classification, particularly with soft binning, appears to alleviate issues related to implicit bias in neural networks, leading to better generalization.
  • Learned Representations are Key: The ability to learn the target encoding and decoding functions from data, rather than relying on hand-picked methods, is crucial for achieving state-of-the-art performance.
  • End-to-End Optimization is Powerful: The joint training of the encoder, decoder, and classifier yields the best results, indicating that optimizing all components simultaneously leads to synergistic improvements.

Key Results

The proposed "end-to-end" joint encoder-decoder classification method consistently outperformed prior regression and classification baselines across a wide range of real-world datasets. Specifically:

  • The end-to-end method achieved the best test set Root Mean Squared Error (RMSE) across all tested datasets.
  • On average, the end-to-end method showed significant improvements, with the paper noting a 25% improvement over the least-squares baseline for their fully end-to-end method.
  • Soft-binning encoder classification also showed substantial gains over hard-binning and least-squares baselines.
  • The paper highlights that the gains are not solely due to architectural choices (like adding a softmax layer) but rather the proposed task reformulation.

Limitations and Future Work

  • Hyperparameter Sensitivity: The choice of $k$ (number of classes/bins) is a critical hyperparameter. While performance generally improves with $k$, there's a plateau, and larger $k$ increases computational cost. The optimal $k$ depends on the dataset and model.
  • Balancing Loss Terms: For the end-to-end training, finding the right balance between the auto-encoding, KL divergence, and regression loss terms (via hyperparameters $\lambda_{auto}, \lambda_{KL}, \lambda_{pred}$) is important, though the results showed some robustness.
  • Future Work: The paper suggests that their framework naturally interpolates between different objectives and can connect supervised and unsupervised approaches to target encoding. Further exploration of different encoder-decoder architectures and loss functions could be beneficial. The interpretability of learned codes as representations of target data is also a promising avenue for future research.

Summary updated

BibTeX
@misc{stewart2025building,
  author = {Lawrence Stewart and Francis R. Bach and Quentin Berthet},
  title = {{Building Bridges between Regression, Clustering, and Classification}},
  year = {2025},
  eprint = {2502.02996},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.02996},
}
Figure