BACKGROUND: The Healthy Eating Index (HEI-2015) assesses dietary quality, and lower scores may be associated with an increased risk of frailty. However, few epidemiological studies have examined the relationship between HEI-2015 and the Frailty Index (FI). This study explores the association between HEI-2015 and FI using data from the U.S. National Health and Nutrition Examination Survey (NHANES), analyzing how factors such as gender and age influence this relationship. METHODS: TNHANES data (2007-2018) were analyzed using logistic regression models to assess the HEI-2015-frailty association. Frailty diagnosis was based on physical activity, strength, fatigue, weight change, and gait speed, with FI scores ranging from 0 to 1. A threshold of 0.21 classified frailty. The R package "DALEX" was used for feature importance analysis to enhance the prediction of frailty. From this analysis, we selected 10 key factors to further improve the accuracy of frailty prediction. RESULT: Of 14,300 participants, 16.2% (2,322) were classified as frail. Frail participants had lower income, higher BMI, lower physical activity, and lower HEI-2015 scores. Higher HEI-2015 scores were associated with reduced frailty risk (adjusted OR: 0.69, 95% CI: 0.56-0.87, P <
0.01). The negative association was stronger in women, higher-income groups, and those with higher education (P <
0.01). Feature importance analysis showed HEI-2015 was the top predictor of frailty. CONCLUSION: Higher HEI-2015 scores are linked to lower frailty risk. Promoting healthy eating may prevent frailty, especially in high-risk groups, with education and demographic factors influencing this relationship.