An Empirical Study on Feature Discretization

Qiang Liu, Zhaocheng Liu, Haoli ZhangarXiv 2020

Abstract

When dealing with continuous numeric features, we usually adopt feature discretization. In this work, to find the best way to conduct feature discretization, we present some theoretical analysis, in which we focus on analyzing correctness and robustness of feature discretization. Then, we propose a novel discretization method called Local Linear Encoding (LLE). Experiments on two numeric datasets show that, LLE can outperform conventional discretization method with much fewer model parameters.

Introduction

In machine learning, continuous numeric features such as age or temperature are often difficult for models like Logistic Regression (LR) or Deep Neural Networks (DNNs) to process effectively in their raw form. A common solution is discretization, which involves partitioning the range of values into discrete bins. However, this approach introduces a fundamental trade-off between correctness and robustness. Small bins offer higher precision (correctness) but are prone to overfitting and noise sensitivity (low robustness), while large bins are stable but lose critical data nuances.

Existing advanced methods, such as Multi-Granularity Discretization (MGD), attempt to mitigate this by utilizing multiple bin sizes simultaneously. While effective, MGD significantly increases the number of model parameters, leading to high computational and memory costs.

Methodology: Local Linear Encoding (LLE)

To address the limitations of static binning, we propose Local Linear Encoding (LLE). Unlike traditional methods that assign a single value to all points within a bin, LLE utilizes linear interpolation between bin boundaries, which act as "anchors."

For a bin defined by boundaries $v_a$ and $v_b$, each boundary is assigned its own embedding ($e_a$ and $e_b$). For any value $v_c$ within the bin, the model computes a weighted average of these boundary embeddings based on the proximity of $v_c$ to each boundary. This creates a piecewise linear approximation of the feature, capturing trends within the bin rather than treating it as a flat plateau. Mathematically, LLE maintains the robustness of larger bins while achieving the correctness of much finer discretization.

Experimental Evaluation

We evaluated LLE against Common Discretization (CD) and Multi-Granularity Discretization (MGD) using two large-scale particle physics datasets from the UCI Machine Learning Repository:

  • HIGGS: 11 million instances from Monte Carlo simulations.
  • SUSY: 5 million instances focused on supersymmetry signal detection.

Tests were conducted across different data scales (100%, 10%, and 1%) to assess performance under varying data availability.

Results and Discussion

LLE consistently outperformed both CD and MGD across Logistic Regression and DNN architectures. As shown in the performance table below, LLE with a small number of bins (e.g., 10) often surpassed standard discretization using 100 bins.

Table 1: Performance comparison of different discretization approaches across datasets and data scales.

A significant advantage of LLE is its extreme parameter efficiency. Traditional methods require a new parameter for every bin, and MGD compounds this by using multiple granularities. In contrast, LLE only requires parameters for the bin boundaries.

Table 2: Comparison of model parameters between MGD and LLE.

On the HIGGS dataset, MGD required 162,560 parameters, whereas LLE achieved superior results with only 308 parameters. This efficiency makes LLE highly suitable for memory-constrained environments without sacrificing predictive power. Furthermore, LLE demonstrated greater stability across different training set sizes, indicating better generalization from limited data.

Conclusion

Local Linear Encoding (LLE) provides a robust and efficient alternative to traditional feature discretization. By employing piecewise linear interpolation, it breaks the traditional trade-off between correctness and robustness. While currently focused on 1D features and linear interpolation within bins, future work could explore higher-order interpolations like splines or automated bin boundary optimization to further enhance performance.

Summary updated

BibTeX
@misc{liu2020empirical,
  author = {Qiang Liu and Zhaocheng Liu and Haoli Zhang},
  title = {{An Empirical Study on Feature Discretization}},
  year = {2020},
  eprint = {2004.12602},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2004.12602},
}
Figure