Feature engineering remains a critical yet challenging bottleneck in machine learning, particularly for tabular data, as identifying optimal features from an exponentially large feature space traditionally demands substantial domain expertise. To address this challenge, we introduce FAMOSE (Feature AugMentation and Optimal Selection agEnt), a novel framework that leverages the ReAct paradigm to autonomously explore, generate, and refine features while integrating feature selection and evaluation tools within an agent architecture. To our knowledge, FAMOSE represents the first application of an agentic ReAct framework to automated feature engineering, especially for both regression and classification tasks. Extensive experiments demonstrate that FAMOSE is at or near the state-of-the-art on classification tasks (especially tasks with more than 10K instances, where ROC-AUC increases 0.23% on average), and achieves the state-of-the-art for regression tasks by reducing RMSE by 2.0% on average, while remaining more robust to errors than other algorithms. We hypothesize that FAMOSE's strong performance is because ReAct allows the LLM context window to record (via iterative feature discovery and evaluation steps) what features did or did not work. This is similar to a few-shot prompt and guides the LLM to invent better, more innovative features. Our work offers evidence that AI agents are remarkably effective in solving problems that require highly inventive solutions, such as feature engineering.
Figures & tables
Figure 1: Types of AutoML. In traditional AutoML, feature engineering would include feature discovery, such as within OpenFE ( Zhang et al., 2023 ) , or iterative feature modification, such as the method of Piramuthu et al. ( Piramuthu & Sikora, 2009 ) . Although LLM methods, such as CAAFE, often excel at feature generation, iterative feature modification has not been explored as often before now. FAMOSE offers a way to learn through trial-and-error which features work and which ones do not until a better feature is developed.
Figure 2: An illustration of FAMOSE applied to the balance-scale task ( Siegler, 1976 ) . FAMOSE first invents features and observes their performance, in this case using the difference in arm weights to see whether a scale is balanced, tilting right, or tilting left. If performance is insufficient, FAMOSE then thinks about how to create better features, ultimately discovering the feature, moment, that exactly predicts whether a scale is balanced. Because the performance cannot be improved further in this task, the feature discovery step eventually stops. The feature selection step then selects this feature using mRMR ( Ding & Peng, 2005 ) and removes the four extraneous features in the task dataset: W1 , W2 , L1 , and L2 , thus instead of an error-prone model with four features, we discover a perfect predictor with only one feature.
Task
Baseline
OpenFE
AutoFeat
FAMOSE
bike
40.3 ± 1.03
92.09 ± 6.35
41.47 ± 1.01
40.05 ± 0.99
crab
2.32 ± 0.13
2.26 ± 0.15
–
2.34 ± 0.08
cybersecurity_attacks
0.82 ± 0.0
–
–
0.82 ± 0.0
housing
409.58 ± 10.54
432.87 ± 10.22
403.96 ± 9.61
408.56 ± 26.34
insurance
192.89 ± 13.91
190.23 ± 11.18
187.6 ± 12.48
191.64 ± 11.16
forest-fires
92.7 ± 5.34
88.52 ± 5.91
93.49 ± 5.42
79.49 ± 5.87
Table 1: RMSE comparison of FAMOSE to SOTA feature engineering algorithms across 5 folds: OpenFE ( Zhang et al., 2023 ) and AutoFeat ( Horn et al., 2019 ) . The “% Reduction” is the mean percent reduction of RMSE across all folds and tasks. This is calculated by replacing any algorithms that could not run with the baseline performance. Bold indicates best model.
Task
Baseline
OpenFE
AutoFeat
FeatLLM
CAAFE
FAMOSE
balance-scale
0.914 ± 0.01
0.999 ± 0.001
0.977 ± 0.025
1.0 ± 0.0
0.965 ± 0.022
1.0 ± 0.0
blood
0.698 ± 0.03
0.681 ± 0.048
0.677 ± 0.033
0.426 ± 0.063
0.697 ± 0.03
0.704 ± 0.027
breast-w
0.989 ± 0.007
0.993 ± 0.004
0.993 ± 0.006
0.994 ± 0.004
0.99 ± 0.01
0.989 ± 0.008
car
0.999 ± 0.0
1.0 ± 0.0
1.0 ± 0.0
0.86 ± 0.019
0.999 ± 0.0
0.997 ± 0.003
cmc
0.704 ± 0.019
0.693 ± 0.013
0.683 ± 0.019
0.709 ± 0.031
0.7 ± 0.02
0.696 ± 0.023
communities
0.866 ± 0.008
–
–
0.808 ± 0.011
0.864 ± 0.007
0.861 ± 0.007
Table 2: ROC-AUC comparison of FAMOSE to SOTA feature engineering algorithms across 5 folds: AutoFeat ( Horn et al., 2019 ) , OpenFE ( Zhang et al., 2023 ) , FeatLLM ( Han et al., 2024 ) , and CAAFE ( Hollmann et al., 2023 ) . Algorithms that could not run due to errors are indicated by “–”. The “% Improvement” is the mean percent increase in ROC-AUC across folds and tasks. This is calculated by replacing any algorithms that could not run with the baseline performance. Bold indicates best model.
Appendix figures & tables14 assets
Supplementary material from the paper’s appendix.
Appendix
Task
# Datapoints
# Features
Imbalance
Target Variance
adult
48842
15
0.24
–
arrhythmia
452
280
0.0
–
balance-scale
625
5
0.08
–
bank_fraud_base
1000000
32
0.01
–
bank_marketing
45211
17
0.12
–
blood
748
5
0.24
–
Appendix
Table S1 : Data statistics: number of datapoints, number of features, data imbalance (if a classification task) or target variance (if a regression task).
Task Type
Task
Prediction Task
Classification
adult ( Becker & Kohavi, 1996 )
Earn more than $50,000 per year (yes/no)
arrhythmia ( Guvenir et al., 1997 )
Presence of cardiac arrhythmia (16 classes)
balance-scale ( Siegler, 1976 )
Balance direction: left, right, or balanced
breast-w ( Wolberg, 1990 )
Breast mass malignant (M) or benign (B)
blood ( Yeh, 2008 )
Blood donation occurred (yes/no)
car ( Bohanec, 1988 )
Car acceptability rating (4 classes)
Appendix
Table S2 : Tasks used to evaluate FAMOSE.
age
“the age of an individual”
workclass
“a general term to represent the employment status of an individual”
fnlwgt
“the number of units in the target population that the responding unit represents”
education
“the highest level of education achieved by an individual”
educational-num
“the highest level of education achieved in numerical form”
marital-status
“marital status of an individual”
occupation
“the general type of occupation of an individual”
Appendix
Table S3 : Example feature descriptions for the adult task.
Table S4 : Example feature descriptions for the bank-marketing task.
Figure S1 : Number of functions used in CAAFE and FAMOSE code across all task folds (5 × number of tasks).
Figure S2 : Frequency each function used in CAAFE code across all task folds (5 × number of tasks).
Figure S3 : Frequency each function used in FAMOSE code across all task folds (5 × number of tasks).
Figure S4 : Percentage of task folds (5 × number of tasks) where FAMOSE or CAAFE features were added.
Baseline
FAMOSE (Claude)
FAMOSE (Deepseek)
adult
0.929 ± 0.002
0.929 ± 0.002
0.929 ± 0.002
balance-scale
0.914 ± 0.01
1.0 ± 0.0
1.0 ± 0.0
bank_fraud_base
0.886 ± 0.004
0.886 ± 0.003
0.885 ± 0.004
bank_marketing
0.934 ± 0.005
0.928 ± 0.013
0.933 ± 0.004
blood
0.698 ± 0.03
0.704 ± 0.027
0.687 ± 0.009
breast-w
0.989 ± 0.007
0.989 ± 0.008
0.986 ± 0.008
Appendix
Table S5 : FAMOSE classifier performance (ROC-AUC) for Claude and Deepseek. We notice that the algorithm works well for both closed-source (Claude 3.5 Sonnet V2) and open-source (Deepseek-R1) LLMs.
Baseline
FAMOSE (Sonnet 3.5 V2)
FAMOSE (Deepseek)
bike
40.3 ± 1.03
40.05 ± 0.99
39.79 ± 0.73
crab
2.32 ± 0.13
2.34 ± 0.08
2.31 ± 0.16
housing
409.58 ± 10.54
408.56 ± 26.34
396.44 ± 19.22
insurance
192.89 ± 13.91
191.64 ± 11.16
190.16 ± 11.96
forest-fires
92.7 ± 5.34
79.49 ± 5.87
79.47 ± 4.6
wine-quality
0.64 ± 0.02
0.64 ± 0.01
0.64 ± 0.02
Appendix
Table S6 : FAMOSE regression performance (RMSE) for Claude and Deepseek. Bold are best-performing models. We notice that the algorithm works well for both closed-source (Claude 3.5 Sonnet V2) and open-source (Deepseek-R1) LLMs, with a slight edge for Deepseek-R1.
Autogluon
Random Forest
Baseline
FAMOSE
Baseline
FAMOSE
adult
0.929 ± 0.003
0.929 ± 0.002
0.903 ± 0.002
0.901 ± 0.005
balance-scale
0.995 ± 0.004
1.0 ± 0.0
0.806 ± 0.009
1.0 ± 0.0
bank_marketing
0.938 ± 0.004
0.937 ± 0.006
0.929 ± 0.004
0.928 ± 0.003
bank_fraud_base
0.877 ± 0.01
0.884 ± 0.006
0.834 ± 0.003
0.835 ± 0.004
blood
0.757 ± 0.035
0.747 ± 0.029
0.686 ± 0.042
0.706 ± 0.03
Appendix
Table S7 : Robustness of classifier performance (ROC-AUC) for FAMOSE XGBoost features applied to different models (Random forest and Autogluon). Bold indicates the best model.
Autogluon
Random Forest
Baseline
FAMOSE
Baseline
FAMOSE
bike
35.37 ± 0.92
35.41 ± 0.96
42.02 ± 1.53
41.97 ± 1.23
crab
2.13 ± 0.11
2.1 ± 0.13
2.19 ± 0.09
2.18 ± 0.09
housing
384.31 ± 15.11
381.08 ± 18.47
418.38 ± 11.23
416.28 ± 14.05
insurance
166.59 ± 13.31
174.56 ± 16.7
178.82 ± 8.87
183.44 ± 11.0
forest-fires
80.89 ± 6.11
79.16 ± 5.59
83.13 ± 5.04
79.22 ± 5.68
Appendix
Table S8 : Robustness of classifier performance (RMSE) for FAMOSE XGBoost features applied to different models (Random forest and Autogluon). Bold indicates the best model.
No goal in prompt
Only feature selection
No feature selection
bike
40.19 ± 0.89
40.3 ± 1.03
40.43 ± 1.54
crab
2.34 ± 0.14
2.34 ± 0.12
2.34 ± 0.09
cybersecurity_attacks
0.82 ± 0.0
0.82 ± 0.0
0.83 ± 0.0
forest-fires
79.87 ± 4.98
79.54 ± 5.89
92.93 ± 5.24
housing
409.03 ± 26.18
409.58 ± 10.54
418.51 ± 38.84
insurance
186.53 ± 12.52
184.43 ± 16.86
193.95 ± 13.82
Appendix
Table S9 : Ablation for regression tasks. We see a slight improvement in the RMSE reduction when we only select features, although the difference is not significant (Wilcoxon signed rank test p-value =0.3 ), but the difference between FAMOSE and no feature selection is significant (Wilcoxon signed rank test p-value =0.007 ). Overall, our results show FAMOSE performs best when we have a goal and feature selection.
No goal in prompt
Only feature selection
No feature selection
adult
0.928 ± 0.002
0.929 ± 0.002
0.929 ± 0.002
balance-scale
1.0 ± 0.0
0.914 ± 0.01
1.0 ± 0.0
bank_fraud_base
0.885 ± 0.004
0.885 ± 0.005
0.881 ± 0.01
bank_marketing
0.928 ± 0.005
0.933 ± 0.004
0.929 ± 0.011
blood
0.678 ± 0.038
0.688 ± 0.024
0.679 ± 0.024
breast-w
0.99 ± 0.008
0.989 ± 0.006
0.985 ± 0.011
Appendix
Table S10 : Ablation for classifier tasks. Due to the small changes in ROC-AUC, the results are not statistically significant, except for only feature selection, which is significantly worse than the baseline and FAMOSE (Wilcoxon signed rank test p-value <0.04 ), which suggests that we need to go beyond feature selection along to achieve high performance. Overall, our results show FAMOSE performs best when we have a goal and feature selection.