Abstract: Auto Feature Engineering (AFE) plays a crucial role in developing practical machine learning pipelines by automating the transformation of raw data into meaningful features that enhance model performance. By generating features in a data-driven manner, AFE enables the discovery of important features that may not be apparent through human experience or intuition. On the other hand, since AFE generates features based on data, there is a risk that these features may be overly adapted to the data, making it essential to assess their reliability appropriately. Unfortunately, because most AFE problems are formulated as combinatorial search problems and solved by heuristic algorithms, it has been challenging to theoretically quantify the reliability of generated features. To address this issue, we propose a new statistical test for generated features by AFE algorithms based on a framework called selective inference. As a proof of concept, we consider a simple class of tree search-based heuristic AFE algorithms, and consider the problem of testing the generated features when they are used in a linear model. The proposed test can quantify the statistical significance of the generated features in the form of $p$-values, enabling theoretically guaranteed control of the risk of false findings.
Introduction: The Challenge of Selection Bias in AFE
Auto Feature Engineering (AFE) is a powerful tool in modern machine learning pipelines, automating the discovery of complex feature transformations (e.g., turning $x_1$ and $x_2$ into $\sin(x_1 \cdot x_2)$) that enhance model performance. However, AFE typically involves searching through a vast combinatorial space of potential features to find those that best fit the data. This data-driven selection process introduces a significant statistical challenge: selection bias.
When the same data is used both to discover a feature and to test its significance, traditional statistical tests (like the standard z-test) become invalid. They tend to produce inflated Type I error rates, leading to "false discoveries" where noise is mistaken for signal. This phenomenon is often referred to as "p-hacking" at scale. Traditionally, researchers have relied on data splitting to mitigate this, but this approach is inefficient as it reduces the amount of data available for both discovery and testing.
Methodology: Selective Inference for AFE
To address these issues, this paper (presented at AISTATS 2025) introduces a novel statistical test based on the framework of Selective Inference (SI). The proposed method allows for valid hypothesis testing on the entire dataset by conditioning the test on the fact that the features were selected by a specific algorithm.
The AFE Algorithm
The researchers focus on a tree-search-based AFE algorithm. In this setup, each node in a directed tree represents a set of features. The algorithm expands the search space by applying mathematical transformations (e.g., sin, exp, or products) to existing features. It uses the Akaike Information Criterion (AIC) as a heuristic to prune the search and identify the most promising feature sets.
The Selective Test and Parametric Programming
The core innovation lies in characterizing the "selection event"—the set of all possible data realizations that would lead the algorithm to choose the exact same set of features. By conditioning on this event, the researchers can derive a truncated distribution for the test statistic, yielding valid $p$-values.
To make this computationally tractable, the authors employ a "line search" method using parametric programming. They identify truncation intervals—specific ranges along a one-dimensional line in the data space where the AFE algorithm's selection remains stable. By integrating over only these intervals, they can calculate a mathematically valid "selective p-value."
Key Results and Insights
The proposed SI-based test was validated using both synthetic and real-world datasets, including benchmarks from the UCI Machine Learning Repository (e.g., Airfoil Self-Noise, Wine Quality, and Energy Efficiency).
- Type I Error Control: In synthetic tests with various noise distributions (including non-Gaussian cases like skew-normal), the SI method consistently controlled the Type I error rate at the target 0.05 level. In contrast, "naive" testing methods failed significantly, producing far too many false positives.
- Higher Statistical Power: Compared to traditional data splitting, the proposed method showed significantly higher power (the ability to correctly identify truly useful features) because it utilizes the full dataset for testing.
- Better Model Fit: On real-world datasets, the features identified and validated by this method consistently resulted in lower (better) AIC values than those found via data splitting. For example, on the Energy Efficiency dataset, the power was 0.38 vs. 0.33 for data splitting.
Limitations and Future Work
While this research provides a rigorous theoretical foundation for AFE, it has some constraints:
- Algorithm Specificity: The current study focused on tree-search AFE. More complex AFEs (like those using genetic algorithms or deep reinforcement learning) would require more complex selection event characterizations.
- Linear Model Constraint: The framework currently tests features within the context of a linear model. Extending this to non-linear downstream models remains an open challenge.
- Computational Overhead: Finding the stability intervals via line search is more computationally demanding than a standard z-test.
For those interested in reproducible research, the authors have made their implementation available on GitHub: Takeuchi-Lab-SI-Group/statistical_test_for_auto_feature_engineering.
Summary updated