Bitpaths: Compressing Datasets Without Decreasing Predictive Performance

Loren Nuyts, Laurens Devos, Wannes Meert, Jesse DavisPKDD/ECML Workshops 2022

Introduction

As machine learning datasets grow in both volume and dimensionality, storage and processing efficiency become critical bottlenecks. Traditional compression methods like ZIP are "ML-blind," failing to preserve the predictive utility of the data. Conversely, existing ML-focused techniques often struggle with mixed data types or fail to provide significant compression. Bitpaths addresses these gaps by using Random Forests to transform complex datasets into compact binary strings, achieving up to 80x compression while maintaining or even enhancing predictive accuracy.

Methodology: The Bitpaths Encoding

Bitpaths is a pattern-mining-based compression scheme that operates in three distinct stages: feature construction, storage, and inference.

Feature Construction

The core of the method involves training a Random Forest (RF) on the original dataset. For each data instance, the algorithm tracks the specific path taken through every tree in the ensemble. At each decision node, a '0' is recorded for a left branch and a '1' for a right branch. The resulting binary string for a single tree has a length equal to the tree depth $d$. The final "Bitpath" representation is the concatenation of these strings across all $m$ trees, resulting in a fixed-length bitstring of $m \times d$ bits.

Encoding data instances as binary paths through an ensemble of decision trees.

Storage and Inference

Instead of high-precision floating-point numbers or high-cardinality categorical features, only the $m \times d$ bitstring is stored. During inference, a new test example is passed through the same Random Forest to generate its Bitpath. A K-Nearest Neighbors (KNN) classifier then identifies the most similar instances in the compressed training set using Hamming distance, which efficiently counts bit differences.

Experimental Evaluation

The authors evaluated Bitpaths across ten diverse datasets, including low-dimensional sets like BreastCancer and large-scale, high-dimensional sets like Gina agnostic (970 features) and Webspam.

Key Results

  • Compression Efficiency: Bitpaths achieved significant compression, reaching a ratio of 77.6x for the Gina agnostic dataset.
  • Predictive Performance: Remarkably, Bitpaths often outperformed KNN on the original feature space, achieving the best average rank in accuracy across all tested datasets. This is attributed to the Random Forest's ability to act as a supervised feature selector, filtering out noise.
  • Robustness to Compression: As shown in the performance curves, many datasets maintain stable accuracy even as the compression ratio increases significantly.
Predictive accuracy remains robust across high compression ratios for diverse datasets.

Discussion and Limitations

The success of Bitpaths stems from using Random Forests as hierarchical encoders that capture the logical structure of the data. However, the method has limitations. It assumes relatively balanced trees; highly imbalanced trees might lead to suboptimal fixed-length encodings. Additionally, while the data is compressed, the inference phase still relies on KNN, which can be computationally intensive for very large datasets. Future work may explore alternative encoding schemes and faster search algorithms for the compressed space.

Summary updated

BibTeX
@inproceedings{nuyts2022bitpaths,
  author = {Loren Nuyts and Laurens Devos and Wannes Meert and Jesse Davis},
  title = {{Bitpaths: Compressing Datasets Without Decreasing Predictive Performance}},
  booktitle = {PKDD/ECML Workshops},
  year = {2022},
  doi = {10.1007/978-3-031-23618-1\_18},
}
Figure