DIFER: Differentiable Automated Feature Engineering
Abstract Feature engineering, a crucial step of machine learning, aims to construct useful features from raw data to improve model performance.
In recent years, great efforts have been devoted to Automated Feature Engineering (AutoFE) to replace expensive human labor.
However, all existing methods treat AutoFE as an optimization problem over a discrete feature space, leading to the problems of feature explosion and computational inefficiency.
Unlike previous work, we perform AutoFE in a continuous vector space and propose a differentiable method called DIFER in this paper.
Specifically, we first propose an evolutionary framework to search for better features iteratively.
In each feature evolution step, we introduce a feature optimizer based on the encoder-predictor-decoder, which maps features into the continuous vector space via the encoder, optimizes the embedding along the gradient direction induced by the predictor, and recovers better features from the optimized embedding by the decoder.
Extensive experiments on classification and regression datasets demonstrate that DIFER can significantly outperform the state-of-the-art AutoFE method in terms of both model performance and computational efficiency.
The implementation of DIFER is avaialable on https://github.com/PasaLab/DIFER .
1 Introduction
Feature engineering, the process of constructing features from raw data, directly determines the upper bound of various machine learning algorithms (e g., Random Forest and Logistic Regression).
However, it requires considerable domain knowledge to construct features.
Also, huge computational resources are needed to evaluate and then filter features.
Thus, it is a cost-intensive task to find useful and meaningful features.
Recently, the AutoFE (Automated Feature Engineering) methods that search for useful features without any human intervention have received more and more attention.
AutoFE formalizes feature construction as applying transformations (e.g., arithmetic operators) to the raw features.
The expansion-reduction algorithm (Kanter and Veeramachaneni, 2015; Lam et al., 2017) iteratively applies all transformations to each feature and selects the features based on the model performance.
Without expert guidance, such method consumes significant computational resources for feature evaluation due to the exponentially growing feature space.
To reduce the cost, learning-based
AutoFE methods are proposed.
TransGraph (Khurana et al., 2018) trains a Q-learning agent to decide the transformation.
Due to applying each action (i.e., transformation) to all features, TransGraph also suffers from the feature explosion problem.
LFE (Nargesian et al., 2017) trains an MLP (MultiLayer Perceptron) to recommend the most likely useful transformation for each feature.
However, it does not support the composition of transformations.
NFS (Chen et al., 2019) generates a feature transformation sequence for each raw feature under the guidance of an RNN controller.
Although
NFS can achieve SOTA (state-of-the-art) performance, the computational efficiency is still low.
An inherent cause of inefficiency for the existing approaches is the fact that AutoFE is treated as an optimization problem over a discrete space.
In this paper, we address the AutoFE problem from a different perspective and propose the first gradient-based approach called DIFER (DIfferentiable automated Feature EngineeRing).
We first propose an evolutionary framework to generate better features iteratively.
Then, in each feature evolution step, we propose a tree-like structure called parse tree to represent constructed features flexibly, and leverage a feature optimizer based on the encoder-predictor-decoder.
Specifically, instead of searching in the discrete feature space, the encoder maps the traversal string of the parse tree into a continuous vector space.
Constructing a better feature is equivalent to generating better embedding in the continuous vector space.
The following predictor takes the feature embedding as input, predicts its performance score, and directly optimizes the embedding by gradient ascent along the score direction.
The optimized embedding is further decoded as a better feature in the discrete space.
Extensive experimental results on both classification and regression tasks reveal that DIFER is not only effective but also efficient.
Compared to the SOTA approach, DIFER achieves better performance on 22 out of 25 datasets with 40 times fewer feature evaluations.
Moreover, DIFER can be effective when using different machine learning algorithms.
To summarize, our main contributions can be highlighted as follows:
• We propose a feature evolution framework to search for better features iteratively.
• To represent constructed features, we design the parse tree structure, which is more flexible and expressive than the commonly-used sequence representation.
• We introduce a novel feature optimizer based on the encoder-predictor-decoder for feature evolution and thus can achieve differentiable AutoFE.
To our best knowledge, DIFER is the first differentiable AutoFE method.
• Extensive experimental results on a variety of tasks demonstrate that DIFER outperforms the stateof-the-art AutoFE approach in terms of both model performance and computational efficiency.
2 Related work
Feature engineering aims to transform raw data into features that can better express the nature of the problem.
Recently, feature engineering has gradually shifted from leveraging human knowledge to automated methods.
Existing AutoFE approaches can be divided into three categories.
Heuristic Approaches: Deep Feature Synthesis (DFS), the component of Data Science Machine (Kanter and Veeramachaneni, 2015), first enumerates all transformations on all features and then performs feature selection directly based on the improvement of model performance.
One Button
Machine (Lam et al., 2017) adopts a similar approach.
However, this expansion-reduction approach suffers from a severe computational performance bottleneck due to the huge feature evaluation overhead.
To avoid enumerating the entire feature space, Cognito (Khurana et al., 2016) introduces a tree-like exploration of feature space and presents handcrafted heuristics traversal strategies such as breadth-first search and depth-first search.
AutoFeat (Horn et al., 2019) iteratively subsamples features using beam search.
However, heuristic approaches cannot learn from past experiences and thus has a low search efficiency.
Learning-Based Approaches: To explore feature space efficiently, learning-based AutoFE methods have been proposed.
LFE (Nargesian et al., 2017) trains an MLP and recommends the most likely useful transformation for each raw feature.
However, it does not support transformation composition and works only for classification tasks.
TransGraph (Khurana et al., 2018) trains a Q-learning agent to decide which transformation should be applied.
Due to performing each transformation on all features, TransGraph suffers from feature explosion and low computational efficiency.
NAS-Based Approaches: Neural Architecture Search (Elsken et al., 2019)
has aroused significant research interests in the field of AutoML (He et al., 2020).
The reinforcement learning-based
NAS method (Zoph and Le, 2017) views the structure of a neural network as a variable-length string.
Then, it uses a recurrent network as the controller to generate such strings and trains the controller with policy gradient.
This approach can be adopted into AutoFE.
For instance, NFS (Chen et al., 2019), the current SOTA AutoFE method, utilizes several RNN-based controllers to generate transformation sequences for each raw feature.
However, evaluating enormous sequences results in substantial computational overhead.
Most importantly, due to the side effects of reducing binary transformations to unary ones, NFS cannot generate complex features like 𝐴 + 𝐵 𝐶 − 𝐷 .
To improve the computational efficiency of NAS, differentiable methods have been proposed.
DARTS (Liu et al., 2018) relaxes the categorical choice to a softmax over all possible operations, leading to a differentiable learning objective.
NAO (Luo et al., 2018) maps the discrete architecture space to a continuous hidden space and optimizes existing architectures in the continuous space.
The differentiable NAS methods bring more inspiration to AutoFE.
In this paper, we propose the first differentiable AutoFE method called DIFER, which can efficiently construct useful low-order and high-order features with much fewer feature evaluations.
3 Methodology 3.1 Problem Formulation
Let 𝐷 = (cid:104) 𝐹,𝑦
(cid:105) be a dataset with a target vector 𝑦 and 𝑛 𝑑 -dimensional instances
𝐹 = { 𝑓 1 , · · · , 𝑓 𝑑 } , where 𝑓 𝑖 ∈ R 𝑛 is the 𝑖 -th raw feature.
We denote the performance of the machine learning model 𝑀 that is learned from 𝐷 and measured by an evaluation metric 𝐿 (e.g., F1-score or mean squared error) as 𝐿 𝑀 ( 𝐹,𝑦 ) .
Without loss of generality, the higher 𝐿 𝑀 indicates better model performance.
Furthermore, we apply the composition of transformations 𝑡 ∈ R 𝑛 × · · · × R 𝑛 → R 𝑛 to features for constructing new features.
Let 𝑜 denote the arity of the transformation 𝑡 , we construct a new feature ˆ 𝑓 = 𝑡 (cid:16) ˆ 𝑓 1 , · · · , ˆ 𝑓 𝑜 (cid:17) , where ˆ 𝑓 𝑗 denotes the 𝑗 -th input of 𝑡 to construct ˆ 𝑓 for 𝑗 ∈ { 1 , · · · ,𝑜 } .
Given a set of transformations with different arities 𝑇 =
{ 𝑡 1 , · · · , 𝑡 𝑚 } , we define the feature space 𝐹 𝑇 as follows: ∀ ˆ 𝑓 ∈ 𝐹 𝑇 , ˆ 𝑓 satisfies any of the following conditions:
• ˆ 𝑓 ∈ 𝐹 • ∃ 𝑡 ∈ 𝑇, ˆ 𝑓 = 𝑡 (cid:16) ˆ 𝑓 1 , · · · , ˆ 𝑓 𝑜 (cid:17) , where ˆ 𝑓 1 , · · · , ˆ
𝑓 𝑜 ∈ 𝐹 𝑇
Formally, let 𝛼 ( ˆ 𝑓 ) denote the order of the feature ˆ 𝑓 ∈ 𝐹 𝑇 , 𝛼 ( ˆ 𝑓 ) can be defined as:
[Equation]
For example, we use the composition of the unary transformation square and the binary transformation divide to construct BMI (Body Mass Index), whose order is 2, by divide ( weight , square ( height )) with the raw features weight and height .
Therefore, the goal of AutoFE is to find the set of constructed features 𝐹 ∗ that can achieve the best performance:
[Equation]
In practice, we limit the order of features and search in the feature space 𝐹 𝑇𝑘
= {
ˆ 𝑓 | ˆ 𝑓 ∈ 𝐹 𝑇 ∧ 𝛼 ( ˆ 𝑓 ) ≤ 𝑘 } since the size of the original space is infinite (i.e., | 𝐹 𝑇 | = ℵ 0 ).
we explore 𝐹 𝑇𝑘 and search for top features ranked by the performance metric 𝐿 𝑀 (cid:16) 𝐹 ∪ { ˆ 𝑓 } ,𝑦 (cid:17) as 𝐹 ∗ .
Moreover, similar to most existing AutoFE methods (e.g., NFS (Chen et al., 2019), (Nargesian et al., 2017), and
TransGraph (Khurana et al., 2018)), we also append the constructed features to 𝐹 to maximize the modeling performance for a given algorithm.
3.2 Overview of DIFER
As shown in Figure 1, we propose an evolutionary framework to achieve AutoFE.
The overall framework is divided into three phases: population initialization, feature evolution, and feature selection.
[Figure]
The population initialization phase constructs feature set 𝐹 cand by randomly sampling features from 𝐹 𝑇𝑘 .
We train a machine learner 𝑀 , which takes instances as input and predicts the labels 𝑦 , from scratch and evaluate its performance as the performance score of the feature 𝐿 𝑀 ( 𝐹 ∪ { ˆ 𝑓 } ,𝑦 ) .
Then, we can get the score set 𝑆 cand =
{ 𝐿 𝑀 ( 𝐹 ∪ { ˆ 𝑓 } ,𝑦 )| ˆ 𝑓 ∈ 𝐹 cand } .
The feature evolution phase aims to construct new features iteratively.
In each iteration, we first select top- 𝑑 features from 𝐹 cand according to 𝑆 cand .
To enhance the diversity of evolution, we take two different approaches to generate new features at the same time.
One way is to perform gradient-based optimization based on the feature optimizer and add 𝑑 / 2 optimized features to 𝐹 cand (i.e., exploitation).
The other way is to add 𝑑 / 2 unduplicated randomly-generated features to 𝐹 cand for exploration.
The process of feature evolution is repeated until a maximum number of feature evaluations is reached.
In the feature optimization process, the two key components are the parse-tree-based feature representation and the gradient-directed feature optimizer that consists of an encoder, a predictor, and a decoder.
Due to its flexibility in the optimization of complex feature transformation, the encoder-predictor-decoder-based feature optimizer is suitable for the AutoFE problem.
After the feature evolution phase, we select top features from 𝐹 cand and add them to the original dataset.
The number of added features is adaptively determined with an early-stopping mechanism.
When the model performance no longer increases, we stop adding features to the original dataset.
Case Study.
we show the process of DIFER using the dataset PimaIndian as an example.
DIFER first initializes the population (cid:104) 𝐹 𝑐𝑎𝑛𝑑 , 𝑆 𝑐𝑎𝑛𝑑 (cid:105) by random sampling and evaluating features from 𝐹 𝑇𝑘 .
Then, the feature optimizer is trained on the population.
The detailed training process of feature optimizer is introduced in Section 3.4.
In the feature optimization process, taking the feature min_max ( BloodPressure ) Insulin as an example, we introduce how the input feature is optimized to get a better feature.
As mentioned in Section 3.3, the feature is first parsed as a tree and traversed to the string <
Insulin, Reciprocal ,BloodPressure, MinMax , Multiply >.
The feature optimizer 𝜓 maps it into the continuous vector space as 𝑒 𝑥 via the encoder 𝜓 𝑒 , optimizes the embedding 𝑒 𝑥 along the gradient direction induced by the predictor 𝜓 𝑝 .
The string <
Insulin, Pregnancies, AbsRoot , Multiply , Reciprocal ,BloodPressure, MinMax , Multiply > is recovered from the optimized embedding 𝑒 𝑥 (cid:48) by the decoder 𝜓 𝑑 .
The recovered string is translated to min_
[Equation]
3.3 Feature Representation
As shown in Figure 2, we design a tree-like structure called parse tree to represent constructed features.
Compared with the sequence representation in NFS (Chen et al., 2019) and NAO (Luo et al., 2018), the parse tree is more flexible and expressive, which can represent complex 𝑛 -ary feature transformation operation like 𝐴 + 𝐵 𝐶 − 𝐷 .
The internal node in the parse tree indicates the transformation and the leaf node indicates the raw feature.
We employ reversible post-order traversal to convert the
• <
Insulin, Pregnancies, AbsRoot , Multiply , Reciprocal , BloodPressure, MinMax , Multiply> • < Pregnancies, AbsRoot , Insulin, Multiply , Reciprocal , BloodPressure, MinMax , Multiply> • <
BloodPressure, MinMax , Insulin, Pregnancies, AbsRoot , Multiply , Reciprocal , Multiply> • < BloodPressure, MinMax , Pregnancies, AbsRoot , Insulin, Multiply , Reciprocal , Multiply>
Original Feature
Multiply
MinMax
Reciprocal
Multiply BloodPressure
AbsRoot
Insulin
Pregnancies
Parse
[Figure]
Parse
[Figure]
Post-ordertraversal
[Figure]
Equivalent Traversal String
[Figure]
[Figure]
parse tree into equivalent traversal string 𝑥 as input to the encoder.
The traversal string in Figureshows an example where each word-based token (i
[Figure]
e., the original feature and the transformation) is separated by a comma.
Let 𝑥 𝑟 denote each token in the traversal string, where 𝑟 ∈ { 1 · · · | 𝑥 |} .
Note that the relationship between the parse tree and the traversal string is one-to-many.
When there are transformations where the input order is meaningless (e.g. mul ( 𝑎,𝑏 )
==
mul ( 𝑏, 𝑎 ) ), the same parse tree can be converted into multiple equivalent strings.
This nature can be viewed as a way of data augmentation when training the feature optimizer.
Due to the fixed arity of each transformation, the optimized traversal string can be recovered to a parse tree with no ambiguity.
The translation process can be found in Appendix A.
3.4 Feature Optimizer
DIFER employs a feature optimizer to construct new features based on the existing features.
The feature optimization process is shown in Figure 3a.
Specifically, the feature optimizer 𝜓 consists of an encoder 𝜓 𝑒 , a performance predictor 𝜓 𝑝 , and a decoder 𝜓 𝑑 .
After jointly-training the feature optimizer for convergence, 𝜓 maps features into the continuous vector space via 𝜓 𝑒 , optimizes the embedding along the gradient direction induced by 𝜓 𝑝 , and recovers better features from the optimized embedding by 𝜓 𝑑 .
Encoder.
The encoder 𝜓 𝑒 maps the post-order traversal string 𝑥 ∈ X to a continuous embedding 𝑒 𝑥 ∈ E ⊂ R 𝑒𝑚𝑏 _ 𝑑𝑖𝑚 .
Since the traversal string 𝑥 is a variable-length sequence, we use LSTM (Long Short-Term Memory)
(Hochreiter and Schmidhuber, 1997) as the encoder.
By the sum- pooling technique, the sum of all hidden states 𝐻 𝑥 = { ℎ 1 ,ℎ 2 , · · · ,ℎ | 𝑥 | } of the LSTM as the feature’s continuous representation 𝑒 𝑥 .
Predictor.
The predictor 𝜓 𝑝 ∈ E → R maps the continuous representation 𝑒 𝑥 into its score 𝑠 𝑥 measured by 𝐿 𝑀 ( 𝐹 ∪ { ˆ 𝑓 𝑥 } ,𝑦 ) .
We employ a 5-layer fully-connected MLP as 𝜓 𝑝 .
Decoder.
The decoder 𝜓 𝑑 maps the embedding to the discrete feature space, i.e., the post-order traversal string of the optimized feature.
According to the classical sequence-to-sequence method, we employ an LSTM with the attention mechanism (Bahdanau et al., 2015) as the decoder 𝜓 𝑑 ∈
E → X , which takes 𝑒 𝑥 as the initial hidden state and all hidden states 𝐻 𝑥 in the encoder as the input of each timestamp.
Jointly-Training.
To train the optimizer efficiently, we propose a jointly-training method based on a joint loss.
The training dataset is the initial evaluated population (cid:104) 𝐹 cand , 𝑆 cand (cid:105) .
As shown in Figure 3b, we design a joint loss function that takes both the performance prediction loss L 𝑝𝑝 and the structure reconstruction loss L 𝑟𝑒𝑐 into account.
The value of the hyperparameter 𝜆 that balances L 𝑝𝑝 and L 𝑟𝑒𝑐 is determined adaptively (see Appendix C).
[Equation]
L 𝑝𝑝
[Equation]
3.5 Feature Optimization
After the convergence of the feature optimizer, we directly optimize the feature embedding 𝑒 𝑥 in the continuous space by performing gradient ascent and then decode the optimized embedding into a new feature 𝑥 (cid:48) .
Starting from the constructed feature 𝑥 , we optimize its embedding 𝑒 𝑥 to get a better embedding along the gradient direction induced by the predictor 𝜓 𝑝 :
[Equation]
However, due to the nature that the corresponding parse tree of a feature ˆ 𝑓 𝑥 may have several equivalent post-order traversal strings 𝑋 = { 𝑥 ( 1 ) , 𝑥 ( 2 ) , · · · 𝑥 ( 𝑛 ) } , the strings in 𝑋 are highly similar in the continuous space.
After one step of gradient ascent, the decoded string of 𝑒 𝑥 (cid:48) may still be in 𝑋 .
Thus, we may get the same parse tree.
We call 𝜂 in Equation (4) the evolution rate.
Increasing the evolution rate 𝜂 can solve this problem to some extent (Luo et al., 2018).
However, a large evolution rate would violate the preconditions of gradient ascent, resulting in no guarantee that 𝜓 𝑝 ( 𝑥 + Δ 𝑥 ) > 𝜓 𝑝 ( 𝑥 ) .
Multi-step gradient ascent.
To address this problem, we propose a straightforward but effective strategy.
Specifically, we apply the optimization process in Equation (4) multiple times with a small evolution rate 𝜂 until we get new parse trees.
As a result, the number of times the optimization process (i.e., steps of gradient ascent) is adaptively determined.
We refer to the overall process as feature optimization.
4 Experiments 4.1 Experimental Setting
As with the SOTA method NFS (Chen et al., 2019), we use 25 public datasets from OpenML (Vanschoren et al., 2014), UCI repository (Dua and Graff, 2017), and Kaggle (2021).
There areclassification (C) datasets and 10 regression (R) datasets that have various numbers of features (5 to and instances (100 to 30000).
In all experiments, we set the max order 𝑘 to 5 except in RQ and utilize 9 transformation functions totally.
Moreover, to ensure the fairness, all methods except LFE (Nargesian et al., 2017) have the same feature transformation space.
• Unary transformation: logarithm , square root , min-max normalization , and reciprocal • Binary transformation: addition , subtraction , multiplication , division , and modulo
All experiments are run using Tesla K80 (GPU) and Intel(R)
Xeon(R) CPU E5-2630 v2 instances.
To evaluate the AutoFE method, we use the performance metric ( 1 − ( relative absolute error ))
(Shcherbakov et al., 2013) for the regression task and f1-score for the classification task.
5-fold cross validation using random stratified sampling is employed and the average result is reported.
Except that different ML algorithms are used in RQ4, we utilize Random Forest as default.
We use scikit-learn as the machine learning algorithm library and employ PyTorch to implement the feature optimizer, including LSTM-based encoder and decoder, MLP-based predictor.
In the initialization step of DIFER, we randomly select 512 features as the initial population.
Both the encoder and decoder of the feature optimizer are implemented as a one-layer LSTM.
We empirically set the embedding size of each token in the traversal string and the size of the hidden state to 512.
The predictor is a 5-layer MLP where the number of hidden units in each layer is 1024.
To train the feature optimizer, we choose the Adam optimizer (Kingma and Ba, 2014) with a learning rate of 0.001 and a weight decay of 0.0001.
The number of epochs is 400, and the batch size is 128.
Early stopping is employed with a patience of 10.
In each feature evolution iteration, the value of 𝑑 is empirically set to be the minimum between top 20% of the initial population size and the total number of original features.
The feature evolution runs until the number of feature evaluations reaches the upper limit of 4096.
When optimizing the feature embedding in Equation (4), we perform gradient ascent with an evolution rate 𝜂 of 0.0001.
Moreover, we use the same hyperparameters for all datasets.
The robustness experiments with different hyperparameters can be found in Appendix D.
4.2 Effectiveness of DIFER (RQ1)
In this subsection, we demonstrate the effectiveness of DIFER.
We compare DIFER on 25 datasets with the SOTA and baseline methods, including: (a) Raw: raw dataset without any transformation; (b) Random: randomly applying transformations to each raw feature; (c) DFS (Kanter and Veeramachaneni, 2015): a well-known expansion-reduction method; (d) AutoFeat (Horn et al., 2019): a popular Python library for automated feature engineering and selection; (e) LFE (Nargesian et al., 2017): recommend the most promising transformation for each feature using MLP; (f) NFS (Chen et al., 2019): the SOTA AutoFE method that achieves better performance than other existing approaches (e.g., Khurana et al.
The experimental settings of these methods, such as the set of transformations, the max feature order, and the evaluation metrics are the same as DIFER.
Table 1 shows the comparison results between DIFER and the existing methods.
Moreover, since LEF can only deal with the classification task and the source code is not available, we directly use the best results reported in the original paper (Nargesian et al., 2017).
The comparison results between DIFER and LEF are shown in Table 2.
From Table 1 and Table 2, we can observe that:
• DIFER achieves the best performance in all but four cases.
Although NFS greatly outperforms the baseline methods, DIFER still achieves an average improvement of 2 .
57% over NFS.
For regression tasks, DIFER can even achieve a maximum improvement of 11 .
• DIFER can handle datasets with various numbers of instances and features for both regression and classification tasks and achieve performance improvement on all datasets with an average of 10 . 72% over Raw and an average of 9 .
55% over Random.
• With the benefit of searching in the continuous vector space, DIFER addresses the feature explosion problem while preserving the entire space, and achieves highly competitive performance even on large datasets such as Credit Default (30000 × 25) and AP-omentum-ovary (275 × 10936).
[Table]
Effectiveness of the predictor 𝜓 𝑝 .
Since the accuracy of the predictor determines the quality of the optimized features, here we demonstrate the effectiveness of 𝜓 𝑝 .
We train the feature optimizer using the data augmentation technique mentioned in Section 3.3 on an initialized population of 512 features.
After convergence [Table] the loss L 𝑝𝑝 (i.e., Mean-Squared Error) of the predictor in the training set is 0 . 00106.
To test the predictor [Table] we randomly sample 256 features from the feature space as the test set, which is different from the training set.
The test loss of 𝜓 𝑝 is 0 . 00132.
Both the training loss and the test loss are small and close, demonstrating the effectiveness of the predictor.
Furthermore, we employ the pairwise accuracy metric to evaluate 𝜓 𝑝 .
Let 𝑋 denote the test set.
𝑓 ( 𝑥 ) and 𝑦 denote the predicted performance of 𝜓 𝑝 and the real performance of the feature.
The pairwise accuracy is defined as follows:
[Equation]
where I represents the 0-1 indicator function.
The pairwise accuracy of 𝜓 𝑝 is 0.918, which is close to the ideal value (i.e., 1) and much better than random guess (i.e., 0.5).
4.3 Efficiency of DIFER (RQ2)
The overhead of AutoFE can be divided into two parts: the process of feature evaluation and the training overhead of the controller (i.e., the feature optimizer).
To verify the efficiency of DIFER, we conduct experiments in terms of the total runtime and the number of feature evaluations, respectively.
Table 1, where the datasets are sorted in ascending order of model evaluation time, shows the total runtime T and the average number of feature evaluations for AutoFE, and Figure [Table] [Figure]
[Table] [Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table] [Figure] [Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
to 3500.
[Figure]
do r
[Figure]
f
[Figure]
u r
[Figure]
s
[Figure]
m l _
[Figure]
ua li t y W h
i t e
[Figure]
l _
P i m a
I nd i an
[Figure]
l _
[Figure]
i r f [Figure] il g i
[Figure]
tt e
[Figure]
i
[Figure]
li t y R ed
[Figure]
t F
[Figure]
l _
[Figure]
r t ili t y
G e r m
[Figure]
C r ed i t
H ou
[Figure]
i ng
[Figure]
s t
[Figure]
[Figure] 4 shows the comparison results between NFS and DIFER with a restricted number of feature evaluations. From Table 1 and Figure 4, we can observe that: • In Table 1, DIFER achieves better performance than NFS by using 40 times fewer feature evaluations while still achieving significant performance improvement.
• From the perspective of runtime, the overhead of DIFER is mainly in the training and inference of the feature optimizer compared to NFS which is dominated by feature evaluation.
Therefore, the efficiency advantage of DIFER is more obvious on larger datasets that requires more evaluation time.
For example, compared with NFS, DIFER can achieve 2.9 × , 7.7 × , 11.5 × speedup on APomentum-ovary , Credit Default , gisette , respectively.
• The advantage of DIFER is more significant with a restricted number of feature evaluations measured by Wilcoxon signed-rank test with 𝑝 -value < 0 .
DIFER achieves an average performance improvement of 6 . 89%, doubling that in RQ1.
4.4 Effectiveness of High-Order Features (RQ3)
To evaluate the ability of exploring the high-order feature space, we conduct two experiments:
Analyze the features generated by DIFER during the search process and investigate whether DIFER can indeed search for the high-order features.
[Table]
Choose the max order 𝑘 from 0 to 6, where 𝑘 = 0 means the raw dataset without any feature transformation.
Then, we analyze the performance curve by varying 𝑘 .
Figure 5a shows the number of each order features generated by DIFER with 𝑘 = 5 for each dataset.
High-order features take a considerable average proportion of 80 . 9%, confirming that
DIFER exploits the entire feature space 𝐹 𝑇𝑘 instead of its subspace 𝐹
𝑇𝑖 where 𝑖 < 𝑘 .
Besides, we randomly choose 8 datasets, normalize the performance of DIFER, plot the performance curve with the increasing max order in Figure 5b
[Table]
and draw the following conclusions:
• The overall performance of DIFER stably increases with the max order 𝑘 .
However, when 𝑘 increases to 5, performance improvement become insignificant.
• For most datasets, sufficient performance improvement can be already achieved with 𝑘 = 2.
There is no need to set an excessively large max order in practice.
4.5 Different Machine Learning Algorithms (RQ4)
To further investigate the generalization ability of DIFER, we utilize the commonly-used classification and regression algorithms.
We conduct experiments on all datasets and the performance statistics are shown in Table 3.
Compared to the Raw method, DIFER achieves significant improvement under different algorithms.
For instance, LinearSVR with DIFER even achieves an average improvement of 32 . 72% across 25 datasets and a max improvement of 96 . 98% in Airfoil .
5 Conclusion and Future Work
In this work, we proposed DIFER, to the best of our knowledge, the first differentiable AutoFE method.
DIFER leverages an encoder-predictor-decoder-based feature optimizer, which maps features into the continuous vector space via the encoder, optimizes the embedding along the gradient direction induced by the predictor, and recovers better features from the optimized embedding by the decoder.
Moreover, based on the feature optimizer, we proposed a feature evolution framework to search for better features iteratively.
Experimental results show that DIFER is effective on both classification and regression tasks and can outperform the existing AutoFE methods in terms of both prediction performance and computational efficiency.
The transformation operations in DIFER are for numerical features.
For future work, we plan to automatically search for transformations for different feature types (i.e., numerical and categorical).
Acknowledgements.
This work was supported in part by the National Natural Science Foundation of China (#62102177 and #U1811461), the Natural Science Foundation of Jiangsu Province (#BK20210181), the Key Research and Development Program of Jiangsu Province (#BE2021729), and the Collaborative Innovation Center of Novel Software Technology and Industrialization, Jiangsu,
China.
6 Reproducibility Checklist
All authors must include a section with the AutoML-Conf Reproducibility Checklist in their manuscripts, both at submission and camera-ready time.
The reproducibility checklist is a combination of the NeurIPS ’21 checklist and the nas checklist.
For each question, change the default \answerTODO{} (typeset [TODO] ) to \answerYes{[justification]} (typeset [Yes]), \answerNo{[justification]} (typeset [No]), or \answerNA{[justification]} (typeset [N/A]).
You must include a brief justification to your answer, either by referencing the appropriate section of your paper or providing a brief inline description.
For example:
• Did you include the license of the code and datasets?
[Yes] See Section ?? .
• Did you include all the code for running experiments?
[No] We include the code we wrote, but it depends on proprietary libraries for executing on a compute cluster and as such will not be runnable without modifications.
We also include a runnable sequential version of the code that we also report experiments in the paper with.
• Did you include the license of the datasets?
[N/A]
Our experiments were conducted on publicly available datasets and we have not introduced new datasets.
Please note that if you answer a question with \answerNo{} , we expect that you compensate for it (e.g., if you cannot provide the full evaluation code, you should at least provide code for a minimal reproduction of the main insights of your paper
Please do not modify the questions and only use the provided macros for your answers.
Note that this section does not count towards the page limit.
In your paper, please delete this instructions block and only keep the Checklist section heading above along with the questions/answers below.
For all authors... (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope?
[Yes] (b) Did you describe the limitations of your work?
[Yes] We discuss its limitations in Sectionfor further work.
(c) Did you discuss any potential negative societal impacts of your work?
[No] (d) Have you read the ethics review guidelines and ensured that your paper conforms to them?
[Yes] 2.
If you are including theoretical results... (a) Did you state the full set of assumptions of all theoretical results?
[N/A] (b) Did you include complete proofs of all theoretical results?
[N/A] 3.
If you ran experiments... (a) Did you include the code, data, and instructions needed to reproduce the main experimental results, including all requirements (e.g., requirements.txt with explicit version), an instructive README with installation, and execution commands (either in the supplemental material or as a url)?
[Yes] We use open-source datasets and provide source code to reproduce the results in supplemental material.
(b) Did you include the raw results of running the given instructions on the given code and data?
[Yes] (c) Did you include scripts and commands that can be used to generate the figures and tables in your paper based on the raw results of the code, data, and instructions given?
[Yes] (d) Did you ensure sufficient code quality such that your code can be safely executed and the code is properly documented?
[Yes] (e) Did you specify all the training details (e.g., data splits, pre-processing, search spaces, fixed hyperparameter settings, and how they were chosen)?
[Yes] (f) Did you ensure that you compared different methods (including your own) exactly on the same benchmarks, including the same datasets, search space, code for training and hyperparameters for that code?
[Yes] See Section 4.1.
(g)
Did you run ablation studies to assess the impact of different components of your approach?
[Yes] (h)
Did you use the same evaluation protocol for the methods being compared?
[Yes] (i) Did you compare performance over time?
[No] (j) Did you perform multiple runs of your experiments and report random seeds?
[No] We use 5-fold cross-validation to reduce randomness.
(k) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)?
[No] We use 5-fold cross-validation to reduce randomness.
(l) Did you use tabular or surrogate benchmarks for in-depth evaluations?
[Yes] (m) Did you include the total amount of compute and the type of resources used (e.g., type of gpus, internal cluster, or cloud provider)?
[Yes] Also see Section 4.1.
(n) Did you report how you tuned hyperparameters, and what time and resources this required (if they were not automatically tuned by your AutoML method, e.g. in a nas approach; and also hyperparameters of your own method)?
[Yes] 4.
If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... (a) If your work uses existing assets, did you cite the creators?
[Yes] We use open-source data with citations.
(b) Did you mention the license of the assets?
[No] (c) Did you include any new assets either in the supplemental material or as a url?
[No] (d) Did you discuss whether
and how consent was obtained from people whose data you’re using/curating?
[No] We use open-source data and follow protocols.
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content?
[No] 5.
If you used crowdsourcing or conducted research with human subjects... (a) Did you include the full text of instructions given to participants and screenshots, if applicable?
[N/A] (b) Did you describe any potential participant risks, with links to Institutional Review Board (irb) approvals, if applicable?
[N/A] (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation?
[N/A]
A Translation
Between Three Forms of
Features
As mentioned in Section 3.3, there are three forms of features (i.e., original form, parse tree form and traversal string form).
To generate parse trees from the original features, we design the following context-free grammar in BNF (Backus Normal Form):
• ParseTree (cid:66) 𝑓 1 ,...,𝑑 | UnaryOp ParseTree |
BinaryOp ParseTree ParseTree • UnaryOp (cid:66) logarithm
| abs | root | min-max | normalization | reciprocal • BinaryOp (cid:66) addition | subtraction | multiplication | division | modulo
Through such syntax parser, the features are parsed into the form of parse tree, and then the corresponding strings is derived through post-order traversal.
Similarly, due to the many-to-one relationship between traversing strings and parse trees, strings can be reduced to parse trees.
With features as leaf nodes, the constructed features are finally obtained from the bottom up at the root node through the internal nodes with the operators.
B Neighborhood of Constructed Features
The duplicated post-order traversal strings 𝑋 = { 𝑥 ( 1 ) , 𝑥 ( 2 ) , · · · 𝑥 ( 𝑛 ) } of the feature ˆ 𝑓 𝑥 are highly similar in the continuous space:
[Equation]
(6) where 𝜖 is just a variable used to inscribe the property, not a hyperparameter.
The neighborhood of 𝑋 in the continuous space can be represented as 𝛿 𝑋 = { 𝑒 𝑥 (cid:48) |(cid:107) 𝑒 𝑥 (cid:48) − 1 𝑛 (cid:205) 𝑥
( 𝑗 ) ∈
𝑋 𝑒 𝑥 ( 𝑗 ) (cid:107) 2 ≤ 𝜖 } .
After one step of gradient ascent, the decoded string of 𝑒 𝑥 (cid:48) ∈ 𝛿 𝑥 may still be in 𝑋 .
Thus, the same parse tree is got.
To escape the neighborhood.
, we use multi-step gradient ascent as mentioned in Section 3.5.
C Adaptive Loss Weight Setting
We use the parameter 𝜆 ∈ R + to balance L 𝑝𝑝 and L 𝑟𝑒𝑐 and 𝜆 is determined adaptively.
Inspired by (Goyal et al., 2017), the first 𝑘 epochs are used to warm up the jointly-training of the feature optimizer with 𝜆 = 1.
After the first 𝑘 epochs, we assign 𝜆 = (cid:205) 𝑘𝑖 = 1 L 𝑟𝑒𝑐 / (cid:205) 𝑘𝑖 = 1 L 𝑝𝑝 according to the sum of losses.
This is mainly to make the two losses in the same order of magnitude.
In practice, 𝑘 is empirically set to 5.
D Robustness
We further evaluate whether DIFER is sensitive to different hyperparameters, including evolution rate 𝜂 and population size 𝑝 .
Figure 6a and Figure 6b show the experimental results on 5 randomlyselected datasets that represent both classification and regression tasks.
Figure 6a demonstrates that
DIFER is robust to different settings of 𝜂 .
Empirically, 𝜂 should not be too large in gradient ascent.
A small 𝜂 can get the same or even better results than the large 𝜂 by performing multiple times of gradient ascent.
Moreover, a larger 𝑝 allows the feature optimizer to be fully trained, and a smaller 𝑝 allows more features to be optimized in the case of a limited number of feature evaluations.
As shown in Figure 6b, the performance of DIFER remains stable across different settings of 𝑝 .
E Statistics Comparison
To further statistically evaluate the difference between the AutoFE methods in Table 1, we perform the Friedman test Demšar (2006), which is a non-parametric equivalent of the repeated-measures
ANOVA.
It is used to determine whether or not there is a statistically significant difference.
[Figure] [Figure]
P e
r
f
o r m a n c e =0.0001 =0.
=0.
=0. =0.
(a
Openml
[Figure]
Megawatt
Fertility
Housing Boston SpamBase 0.
P e
r
f o
[Figure]
m a n c e p
[Figure]
128 p
[Figure]
p
[Figure] [Figure]
settings
[Figure]
[Table]
For the comparison results in Table 1, we first calculate the Friedman statistic.
Let 𝑟 𝑗𝑖 be the rank of the 𝑗 -th of 𝑘 AutoFE methods ( 𝑘 = 4, i.e., DFS, AutoFeat, NFS, and DIFER) on the 𝑖 -th of 𝑁 datasets.
The Friedman test compares the average ranks of models, 𝑅 𝑗 = 1 𝑁 (cid:205)
𝑖 𝑟 𝑗𝑖 .
The nullhypothesis states that all the tree models are equivalent and so their ranks 𝑅 𝑗 should be equal.
We employ the scipy tool 1 to calculate the Friedman statistic.
The corresponding Friedman 𝑝 -value is 1.17e-10.
Since the 𝑝 -value is less than 0.05, we can reject the null hypothesis that the performance is the same for all four types of AutoFE methods.
In other words, we have sufficient evidence to conclude that the AutoFE method lead to statistically significant differences in terms of performance.
Since the 𝑝 -value of the Friedman test is statistically significant, we perform the Nemenyi post-hoc test Nemenyi (1963) to further determine exactly which AutoFE method has different means.
Tableshows the 𝑝 -values for each pairwise comparison.
We can conclude that DIFER is significantly different from other trees for a confidence level of 𝑝 = 0 . 05 and show the result by ’*’ in Table1.
In the formal definition, | 𝐹 ∗ | is defined as the set of added features, which does not contain the raw features. Table 5 shows the number of features finally added by AutoFeat, NFS and DIFER. For NFS, it is the number of original features.
Benefit from feature selection, | 𝐹 ∗ | in AutoFeat and DIFER is adaptive.
[Table]
[Table]
[Table]
R
[Table]
R
[Table]
R
[Table] [Table]
[Table]
R
[Table]
Hepatitis
C
[Table] [Table]
Fertility
C 100 \
SpectF
C 267 \
Megawatt
C 253 \
Ionosphere
C 351 \
German Credit
C 1001 \
Credit-a
C 690 \
PimaIndian
C 768 \
Messidor_features
C 1150 \
Wine Quality Red
C 999 \
Wine Quality White
C 4900 \
SpamBase
C 4601 \
AP-omentum-ovary
C 275 \
Err.
Credit Default
C 30000 \   gisette
C 2100 \
Err.