TreeFlow: Going Beyond Tree-Based Parametric Probabilistic Regression

Patryk Wielopolski, Maciej Zieba

TL;DR

TreeFlow tackles the limitation of traditional tree-based regression models that struggle to capture complex, non-Gaussian, and multimodal probability distributions for predictions. By combining tree ensembles as feature extractors with conditional normalizing flows, TreeFlow achieves state-of-the-art results in probabilistic regression, offering more realistic uncertainty estimates.

What Problem Does This Paper Address?

Tree-based ensemble methods, like Random Forests and Gradient Boosting Machines, are workhorses for tabular data due to their robustness and ability to handle mixed-type features. However, when it comes to regression, they typically output either a single point estimate or assume a simple parametric distribution (like Gaussian) for uncertainty. This is a significant limitation because real-world phenomena often exhibit more complex probabilistic behaviors, such as multiple possible outcomes (multimodality) or heavy tails. For instance, predicting a vehicle's future location might involve several possible exits, not just a single point. Existing methods struggle to model these rich distributions, especially in multivariate settings, due to the complexity of estimating covariance matrices or the limitations of parametric assumptions.

Methods

TreeFlow introduces a novel architecture that bridges the gap between tree ensembles and flexible probabilistic modeling. The core idea is to use a tree-based model (specifically, CatBoost is used in the experiments) as a Tree-based Feature Extractor. This component processes the input data and outputs a vector of binary features representing the tree structure. To manage the potentially high dimensionality of this feature vector and prevent it from overwhelming the subsequent probabilistic model, a Shallow Feature Extractor (a small neural network) is employed to map these binary features into a lower-dimensional representation. This compressed representation then serves as the conditioning input for a Conditional Continuous Normalizing Flow (CNF). Normalizing flows are powerful generative models capable of learning arbitrary probability distributions by composing a series of invertible transformations. By conditioning the CNF on the features extracted by the tree ensemble, TreeFlow can model complex, non-Gaussian, and multimodal probability distributions for the regression outputs. The training is performed in a two-stage process: first, the tree-based feature extractor is trained independently, and then the entire model (feature extractor, shallow extractor, and CNF) is fine-tuned end-to-end.

Datasets

The paper evaluates TreeFlow on a variety of datasets across different experimental setups:

  • Univariate regression on synthetic data: A custom dataset was generated to have known true probability distributions (Normal, Exponential, Mixture of Gaussians, Gamma) to directly assess the model's ability to capture these shapes.
  • Univariate regression on mixed-type data: Seven datasets were curated from Kaggle, featuring a mix of categorical and numerical features, and varying sample sizes.
  • Univariate regression on numerical data: Datasets from the UCI Machine Learning Repository were used, excluding the Boston dataset due to ethical concerns.
  • Multivariate regression: Datasets were sourced from existing literature, including an oceanographic dataset and others with varying target dimensionalities.

Key Insights and Ideas

  • Bridging the gap: The most significant insight is the successful integration of tree-based feature extraction with the expressive power of normalizing flows. This combination allows for the modeling of complex probabilistic behaviors that are beyond the reach of traditional tree-based methods.
  • Handling multimodality: TreeFlow excels at capturing multimodal target distributions, providing more realistic uncertainty estimates than Gaussian-based models, which often struggle to represent multiple distinct peaks in the probability distribution.
  • Feature extraction is key: The tree-based feature extractor is crucial for efficiently encoding information from mixed-type tabular data, which is a strength of tree models.
  • Dimensionality reduction is necessary: The shallow feature extractor plays a vital role in making the high-dimensional binary features from the tree ensemble manageable for the normalizing flow, preventing computational bottlenecks and improving training stability.
  • Two-stage training is effective: The proposed two-stage training strategy allows for leveraging pre-trained tree ensembles and simplifies the end-to-end training of the complex TreeFlow architecture.

Key Results

  • State-of-the-art performance: TreeFlow achieved state-of-the-art (SOTA) results on probabilistic metrics (NLL, CRPS) and deterministic metrics (RMSE) for datasets with multimodal target distributions.
  • Competitive performance: It also showed competitive results on unimodal datasets compared to established tree-based regression baselines.
  • Improved probabilistic modeling: For synthetic data with known distributions, TreeFlow accurately modeled complex shapes like mixtures of Gaussians, outperforming CatBoost.
  • Realistic uncertainty: In real-world scenarios (e.g., predicting wine prices), TreeFlow produced more realistic probability distributions, correctly identifying heavy tails and avoiding impossible predictions (like negative prices), unlike Gaussian-based models.
  • Computational efficiency: The ablation study showed that the Shallow Feature Extractor significantly speeds up training (on average 11x faster) by reducing the dimensionality of the conditioning input to the CNF.

Limitations and Future Work

  • Computational cost: The paper acknowledges that the flexibility of the CNF component comes at the cost of increased computational time, limiting scalability for extremely large datasets.
  • Hyperparameter tuning: TreeFlow has multiple hyperparameters that can be challenging to tune, although the paper provides guidance through experimental results.
  • Two-stage training sub-optimality: The two-stage training approach might lead to sub-optimal results in some cases, as the feature extractor is not jointly optimized with the rest of the model from the start.
  • Future work: The authors suggest that TreeFlow serves as a strong foundation for future end-to-end approaches. Further research could explore more efficient CNF architectures or alternative feature extraction methods to improve scalability and potentially achieve fully end-to-end training.

Summary updated

BibTeX
@inproceedings{wielopolski2023treeflow,
  author = {Patryk Wielopolski and Maciej Zieba},
  title = {{TreeFlow: Going Beyond Tree-Based Parametric Probabilistic Regression}},
  booktitle = {ECAI},
  year = {2023},
  url = {https://openreview.net/forum?id=39Hb1ZuLS1w},
}
Figure