Methods
The NHANES is a national survey designed to continuously evaluate the health and nutrition of non-institutionalized residents in the United States. This study was conducted by the Centers for Disease Control and Prevention and was approved by the National Center for Health Statistics. The original study protocol is available on the NHANES Ethics Review Committee website, with the formal approval of the Ethics Review Committee ( https://www.cdc.gov/nchs/nhanes/about/erb.html ). Informed consent was obtained from all participants. Data for this study were collected from four cycles of NHANES, spanning 1999–2006.
In total, 41,474 participants from the NHANES (1999–2006) were included in this study. All data were obtained from the Centers for Disease Control and Prevention ( https://www.cdc.gov/nchs/nhanes/index.htm ). After excluding males ( n = 19,708), 21,766 participants remained. Among them, 15,282 were excluded due to missing data on essential covariates, including age, race, education, family poverty-income ratio (PIR), BMI, smoking and alcohol status, hypertension, and diabetes mellitus, leaving 6,484 participants. Finally, 2,395 participants were excluded due to incomplete inflammatory index data, resulting in a final analytic cohort of 4,089 participants. Figure 1 shows a detailed flowchart of the inclusion criteria for the study population.
Our exposure variables include 20 nutritional-inflammatory indices as follows: white blood cell count (WBC), neutrophil percent (NEU%), neutrophil number (NEU), lymphocyte percent (LYM%), lymphocyte number (LYM), monocyte percent (MONO%), monocyte number (MONO), platelet count (PLT), C-reactive protein (CRP; mg/dL), albumin (ALB; g/L), systemic immune inflammation index (SII), neutrophil-to-lymphocyte ratio (NLR), platelet-to-lymphocyte ratio (PLR), lymphocyte-to-monocyte ratio (LMR), neutrophil-to-platelet ratios (NPR), platelet-to-albumin ratio (PAR), C-reactive protein-to-albumin ratio (CAR), C-reactive protein-to-lymphocyte ratio (CLR), neutrophil percentage-to-albumin ratio (NPAR), and CRP-albumin-lymphocyte index (CALLY). Supplementary Table 1 presents the formulas used for calculating these indices. The required variables were obtained from the NHANES laboratory analysis conducted in the mobile examination. Complete blood count parameters were derived using the Beckman Coulter method for counting and sizing, with automatic sample processing and hemoglobinometry using a single-beam photometer. WBC differential analysis was performed using volume-conductance-scatter technology. CRP was quantified using latex-enhanced nephelometry, in which CRP forms an antigen-antibody complex with latex particles coated with anti-CRP antibodies; the concentrations are determined using a calibration curve. Albumin concentration was measured using a bichromatic digital endpoint method, where albumin forms a complex with bromocresol purple reagent, and the change in absorbance at 600 nm was proportional to the albumin concentration.
Educational attainment was categorized into the following three groups: below high school, high school or equivalent, and college or higher. The family PIR was classified as low (< 1.3), median (1.3–3.5), and high (≥ 3.5) income categories. Smoking status was classified into three categories as follows: never, ever, and currently. Alcohol consumption was categorized as either “no” or “yes.” Hypertension was defined as systolic blood pressure ≥ 140 mmHg, diastolic blood pressure ≥ 90 mmHg, a self-report of being informed by a doctor that they have high blood pressure, or currently using prescribed medication for hypertension. Diabetes mellitus was defined by any of the following criteria: fasting glucose ≥ 7.0 mmol/L, glycated hemoglobin ≥ 6.5%, self-report of being diagnosed with diabetes mellitus by a doctor, or using insulin or oral medications to manage blood glucose levels. Endometriosis was diagnosed if a participant responded “yes” to the question, “Told by the doctor to have endometriosis?”
To describe the distribution of demographic and exposure variables in the endometriosis and non-endometriosis groups, normally distributed continuous variables are presented as means and standard deviations, whereas those that are non-normally distributed are expressed as medians and interquartile ranges. Between-group comparisons were made using the t-test and Wilcoxon test for normally and non-normally distributed data, respectively. Categorical variables are expressed as proportions and compared using the χ² test. Multivariate logistic regression was used to examine the relationship between inflammatory indices and endometriosis diagnosis, adjusting for age, race, BMI, education, family PIR, cycle, smoking status, alcohol use status, hypertension, and diabetes mellitus.
All statistical analyses were conducted using R (version 4.0.3), with the statistical significance set at P < 0.05 for the two-sided test.
In this study, we implemented the following six ML algorithms: LR, KNN, RF, SVM, and XGBoost. The dataset was categorized into 80% and 20% for training and testing, respectively. Hyperparameters for all models were optimized using grid search and five-fold cross-validation for efficient parameter tuning. Model performance was assessed using sensitivity, specificity, and area under the curve (AUC). We selected XGBoost as the best model based on its highest AUC, indicating its superior accuracy compared to the other models. For each model, calibration curves and net benefit scores were computed for the training and test sets to evaluate clinical utility. Decision function scores and predicted probabilities were calculated to assess the receiver operating characteristic (ROC) curves.
SHAP values were used to assess feature importance and model behavior to enhance interpretability. Additionally, SHAP interaction values were computed to examine how the features interacted with each other. In the SHAP summary plot, age, race, MONO%, PLT, BMI, PAR, NPAR, LMR, and education were identified as the top nine features that contributed the most to the prediction outcomes. These nine variables were selected and used to reconstruct a new model using the XGBoost algorithm. The newly constructed model’s performance was evaluated using the confusion matrix and AUC to assess its classification accuracy and discriminatory power. To facilitate the use of this predictive model, the pre-trained model was saved, and the entire model, including the SHAP visualizations, was deployed as an interactive web tool. This application was created using the Shiny framework and is hosted on GitHub ( https://github.com/ ). Render ( https://render.com/ ), an online platform that generates websites by reading repositories from GitHub, was used to create our interactive website, allowing researchers to input their data.
Explainable ML models were developed and evaluated using Python (version 3.8.1). The Python libraries used in this study included shiny, pandas, numpy, joblib, shap, matplotlib, os, scikit-learn, seaborn, and xgboost.
Results
Figure 1 illustrates the stepwise selection process for the study participants. Data from 41,474 participants in the NHANES (1999–2006) were analyzed. After excluding males ( n = 19,708), 21,766 participants remained. Subsequently, 15,282 participants with missing key information, including age, race, education, family PIR, BMI, smoking and alcohol status, hypertension, and diabetes mellitus, were excluded, leaving 6,484 participants. Finally, 2,395 participants with missing inflammatory index data were excluded, resulting in a final cohort of 4,089 participants for analysis.
Fig. 1 Study flow chart. Family PIR, family poverty income ratio; BMI, body mass index; DM, diabetes mellitus; NHANES, National Health and Nutrition Examination Survey.
Study flow chart. Family PIR, family poverty income ratio; BMI, body mass index; DM, diabetes mellitus; NHANES, National Health and Nutrition Examination Survey.
Table 1 summarizes the baseline characteristics of the 4,089 participants, stratified according to endometriosis status. Participants with endometriosis had a significantly higher median age compared to those without endometriosis (40 vs. 34 years, P < 0.0001). Significant differences in racial composition were observed, with a higher proportion of non-Hispanic White individuals (68.8% vs. 43.0%) and a lower proportion of Mexican Americans (7.6% vs. 26.5%, P < 0.0001) in the endometriosis group than in the non-endometriosis group. Family PIR distribution also differed significantly between the groups, with more patients with endometriosis in the high-income category in the endometriosis group than in the non-endometriosis group (50.7% vs. 32.1%, P < 0.0001). Educational attainment was significantly associated with endometriosis. Individuals with college degrees or higher were more prevalent in the endometriosis group than in the non-endometriosis group (59.9% vs. 52.1%, P < 0.0001). Lifestyle factors, including smoking and alcohol consumption, differed significantly between the groups. The endometriosis group had higher proportions of smokers (30.9% vs. 20.8%, P = 0.0002) and alcohol consumers (64.5% vs. 56.2%, P = 0.0058) than the non-endometriosis group. BMI showed no significant difference between the groups ( P = 0.5612). Hypertension prevalence was higher in the endometriosis group than in the non-endometriosis group (31.9% vs. 18.9%, P < 0.0001), whereas diabetes mellitus prevalence did not differ significantly ( P = 0.3548). Hematological indicators, such as PAR ( P = 0.0178), also differed significantly, indicating potential biological distinctions related to endometriosis.
Table 1 Comparison of participant characteristics grouped by endometriosis. Characteristics Endometriosis P value b Overall(n = 4,170) No(n = 3,866) Yes(n = 304)
Age (median [IQR])
35.0 [27.0, 44.0] 34.0 [26.0, 44.0] 40.0 [34.0, 46.0] < 0.0001
Race (%)
Non-Hispanic White 1,873 (44.9) 1,664 (43.0) 209 (68.8) Non-Hispanic Black 853 (20.5) 802 (20.7) 51 (16.8) Mexican American 1,049 (25.2) 1,026 (26.5) 23 (7.6) < 0.0001 Other Hispanic 210 (5.0) 201 (5.2) 9 (3.0) Other Race 185 (4.4) 173 (4.5) 12 (3.9)
Family PIR (%)
Low income 1,235 (29.6) 1,176 (30.4) 59 (19.4) Median income 1,541 (37.0) 1,450 (37.5) 91 (29.9) High income 1,394 (33.4) 1,240 (32.1) 154 (50.7) < 0.0001
Education (%)
Below high school 1,057 (25.3) 1,020 (26.4) 37 (12.2) College and above 2,196 (52.7) 2,014 (52.1) 182 (59.9) High school 917 (22.0) 832 (21.5) 85 (28.0) < 0.0001
Smoke (%)
Non-smoker 3,097 (74.3) 2,899 (75.0) 198 (65.1) History smoker 176 (4.2) 164 (4.2) 12 (3.9) Current smoker 897 (21.5) 803 (20.8) 94 (30.9) 0.0002
Alcohol (%)
No 1,803 (43.2) 1,695 (43.8) 108 (35.5) 0.0058 Yes 2,367 (56.8) 2,171 (56.2) 196 (64.5)
BMI (mean (SD))
28.7 (7.2) 28.6 (7.2) 28.9 (7.3) 0.5612
Hypertension (%)
No 3341 (80.1) 3134 (81.1) 207 (68.1) < 0.0001 Yes 829 (19.9) 732 (18.9) 97 (31.9)
DM (%)
Non-DM 3,951 (94.7) 3,659 (94.6) 292 (96.1) DM 219 (5.3) 207 (5.4) 12 (3.9) 0.3548
WBC (mean (SD))
7.8 (2.5) 7.8 (2.5) 7.9 (2.4) 0.3329
NEU% (mean (SD))
60.4 (10.0) 60.4 (10.0) 60.3 (10.3) 0.7888
LYM% (mean (SD))
29.4 (8.8) 29.3 (8.8) 29.6 (9.1) 0.6222
LYM (median [IQR])
2.1 [1.7, 2.5] 2.1 [1.7, 2.5] 2.1 [1.8, 2.7] 0.068
MONO% (mean (SD))
7.2 (2.0) 7.2 (2.0) 7.3 (2.0) 0.2089
MONO (median [IQR])
0.5 [0.4, 0.6] 0.5 [0.4, 0.6] 0.5 [0.4, 0.6] 0.0688
PLT (mean (SD))
290.3 (72.8) 290.2 (73.2) 291.7 (67.1) 0.7454
CRP (median [IQR])
0.3 [0.1, 0.7] 0.3 [0.1, 0.7] 0.4 [0.1, 0.7] 0.0103
ALB (median [IQR])
42.0 [39.0, 44.0] 42.0 [39.0, 44.0] 42.0 [39.0, 44.0] 0.6875
NEU(mean (SD))
4.8 (2.0) 4.8 (2.0) 4.9 (2.0) 0.5882
SII (mean (SD))
687.4 (422.2) 687.4 (424.9) 687.6 (387.0) 0.9951
NLR (mean (SD))
2.4 (1.3) 2.4 (1.3) 2.4 (1.3) 0.8058
PLR (mean (SD))
143.6 (53.0) 143.8 (53.0) 142.0 (53.6) 0.5761
LMR (mean (SD))
4.4 (1.7) 4.4 (1.8) 4.3 (1.4) 0.251
NPR (median [IQR])
0.0 [0.0, 0.0] 0.0 [0.0, 0.0] 0.0 [0.0, 0.0] 0.9693
PAR (mean (SD))
7.1 (2.0) 7.1 (2.0) 7.1 (1.8) 0.8167
CAR (median [IQR])
0.0 [0.0, 0.0] 0.0 [0.0, 0.0] 0.0 [0.0, 0.0] 0.0178
CLR (median [IQR])
0.1 [0.0, 0.3] 0.1 [0.0, 0.3] 0.2 [0.1, 0.4] 0.0239
CALLY (median [IQR])
30.5 [12.6, 90.0] 31.0 [12.8, 92.0] 25.2 [11.3, 60.2] 0.0365
NPAR (mean (SD))
1.5 (0.4) 1.5 (0.4) 1.5 (0.3) 0.2306
Cycle (%)
1999–2000 902 (21.6) 840 (21.7) 62 (20.4) 0.9598 2001–2002 1,084 (26.0) 1,004 (26.0) 80 (26.3) 2003–2004 1,084 (26.0) 1,004 (26.0) 80 (26.3) 2005–2006 1,100 (26.4) 1,018 (26.3) 82 (27.0)
Age (median [IQR])
35.0 [27.0, 44.0] 34.0 [26.0, 44.0] 40.0 [34.0, 46.0] < 0.0001
Race (%)
Non-Hispanic White 1,873 (44.9) 1,664 (43.0) 209 (68.8) Non-Hispanic Black 853 (20.5) 802 (20.7) 51 (16.8) Mexican American 1,049 (25.2) 1,026 (26.5) 23 (7.6) < 0.0001 Other Hispanic 210 (5.0) 201 (5.2) 9 (3.0) Other Race 185 (4.4) 173 (4.5) 12 (3.9)
Family PIR (%)
Low income 1,235 (29.6) 1,176 (30.4) 59 (19.4) Median income 1,541 (37.0) 1,450 (37.5) 91 (29.9) Family PIR, family poverty income ratio; BMI, body mass index; DM, diabetes mellitus; WBC, white blood cell; NEU%, neutrophils percent; LYM%, lymphocyte percent; LYM, lymphocyte number; MONO%, monocyte percent; MONO number, monocyte number; PLT, platelet count; CRP, c-reactive protein; ALB, albumin; NEU, neutrophils number; SII, systemic immune inflammation index; NLR, neutrophil-to-lymphocyte ratio; PLR, platelet-to-lymphocyte ratio; LMR, lymphocyte-to-monocyte ratio; NPR, neutrophil-to-platelet ratio; PAR, platelet-to-albumin ratio; CAR, CRP-to-albumin ratio; CLR, CRP-to-lymphocyte ratio; CALLY, CRP-albumin-lymphocyte index; NPAR, neutrophil percentage-to-albumin ratio. a The sum of these proportions did not equal 100% due to the use of the rounding-off method. b Based on the χ² test, t-test, and Wilcoxon test for categorical, normally distributed continuous, or non-normally distributed continuous variables, respectively.
Comparison of participant characteristics grouped by endometriosis.
Family PIR, family poverty income ratio; BMI, body mass index; DM, diabetes mellitus; WBC, white blood cell; NEU%, neutrophils percent; LYM%, lymphocyte percent; LYM, lymphocyte number; MONO%, monocyte percent; MONO number, monocyte number; PLT, platelet count; CRP, c-reactive protein; ALB, albumin; NEU, neutrophils number; SII, systemic immune inflammation index; NLR, neutrophil-to-lymphocyte ratio; PLR, platelet-to-lymphocyte ratio; LMR, lymphocyte-to-monocyte ratio; NPR, neutrophil-to-platelet ratio; PAR, platelet-to-albumin ratio; CAR, CRP-to-albumin ratio; CLR, CRP-to-lymphocyte ratio; CALLY, CRP-albumin-lymphocyte index; NPAR, neutrophil percentage-to-albumin ratio.
a The sum of these proportions did not equal 100% due to the use of the rounding-off method.
b Based on the χ² test, t-test, and Wilcoxon test for categorical, normally distributed continuous, or non-normally distributed continuous variables, respectively.
Multivariate logistic regression analysis was performed to preliminarily explore the associations between predictors and endometriosis risk (Supplementary Fig. 1). Higher CRP quartiles were associated with an increased risk of endometriosis ( P = 0.03). An elevated CAR was associated with a higher risk of endometriosis ( P = 0.005). The odds ratios (OR) for CAR were 1.147 (95% confidence interval (CI): 0.796–1.654) for Q2, 1.631 (95% CI: 1.635–2.343) for Q3, and 1.624 (95% CI: 1.092–2.416) for Q4 compared with Q1. PLT exhibited a non-linear relationship, with ORs of 1.138 (95% CI: 0.801–1.615) for Q2, 1.495 (95% CI: 1.066–2.097) for Q3, and 0.963 (95% CI: 0.669–1.385) for Q4 compared with Q1. These findings suggest a potential association of PLT, CAR, and CRP levels with endometriosis risk.
To evaluate the predictive performance of all variables, five ML models (LR, KNN, RF, SVM, and XGBoost) were assessed using ROC curves, confusion matrices, calibration curves, and decision curve analysis (Fig. 2 ). The XGBoost model revealed the highest discriminative ability, achieving an AUC of 0.87, followed by RF (AUC = 0.84), KNN (AUC = 0.77), SVM (AUC = 0.75), and LR (AUC = 0.71). These results indicate that XGBoost is the most effective model for distinguishing between endometriosis and non-endometriosis cases.
Fig. 2 Performance evaluation of machine-learning models, comparing LR, KNN, RF, SVM, and XGBoost models on the training and test sets. ROC curves ( a ), confusion matrices ( b ), calibration curves ( b ), and decision curve analysis ( d ). LR, Logistic Regression; KNN, K-Nearest Neighbors; RF, Random Forest; SVM, Support Vector Machine; XGBoost, extreme Gradient Boosting; ROC, receiver operating characteristic; FP, false positive; TP, true positive.
Performance evaluation of machine-learning models, comparing LR, KNN, RF, SVM, and XGBoost models on the training and test sets. ROC curves ( a ), confusion matrices ( b ), calibration curves ( b ), and decision curve analysis ( d ). LR, Logistic Regression; KNN, K-Nearest Neighbors; RF, Random Forest; SVM, Support Vector Machine; XGBoost, extreme Gradient Boosting; ROC, receiver operating characteristic; FP, false positive; TP, true positive.
The confusion matrix revealed superior classification performance for XGBoost, with 770 true positives and 34 true negatives correctly predicted. XGBoost achieved a true positive rate of 53.1%, a true negative rate of 100%, a false positive rate of 0%, and a false negative rate (FNR) of 46.9%, with the lowest FNR among all models. Additionally, XGBoost exhibited the best calibration consistency between predicted probabilities and observed outcomes, as evidenced by the lowest Brier scores (training set: 0.002; test set: 0.036), validating its reliability in probability estimation. The decision curve analysis confirmed the clinical utility of XGBoost, revealing the highest net benefit across a wide range of threshold probabilities in the training and testing datasets. Model selection was primarily based on the AUC combined with other evaluation metrics, which collectively confirmed that XGBoost was the most robust model for predicting endometriosis.
The SHAP feature importance plot (Fig. 3 a) illustrates the contribution of individual features to the XGBoost model’s prediction of endometriosis. SHAP values were computed at the local level for each individual, quantifying the contribution of each predictor to the model’s output relative to the expected baseline. Visualization, including summary plots, dependence plots, force plots, and interaction plots, was based on these local SHAP values to illustrate feature effects and potential interactions across samples. Feature contributions were summarized by evaluating distributions of local SHAP values across the dataset, revealing the relative importance of each predictor in the overall model. Additionally, the most influential predictors, ranked by the mean absolute SHAP values, were age, race, MONO%, PLT, BMI, PAR, NPAR, LMR, and education. Higher SHAP values indicated a greater impact of these features on the model’s output. Among these predictors, age had the highest contribution, followed by race and MONO%. The effects of these features vary with changes in their respective values, as depicted by the color gradient in the plots, which highlights the nuanced relationship between the feature values and their contributions to the predictions.
Fig. 3 SHAP analysis of model feature importance and interactions. ( a ) Summary plot of SHAP values showing the impact of features on the model output, where feature values are colored from low (blue) to high (pink). ( b ) Scatter plots for selected features (MONO%, PLT, PAR, NPAR, and LMR) showing the relationship between SHAP and feature values, with LOWESS curves indicating trends and interaction points. Family PIR, family poverty income ratio; BMI, body mass index; LYM%, lymphocyte percent; LYM, lymphocyte number; MONO%, monocyte percent; PLT, platelet count; CRP, c-reactive protein; PLR, platelet-to-lymphocyte ratio; LMR, lymphocyte-to-monocyte ratio; NPR, neutrophil-to-platelet ratio; PAR, platelet-to-albumin ratio; CAR, CRP-to-albumin ratio; CLR, CRP-to-lymphocyte ratio; CALLY, CRP-albumin-lymphocyte index; NPAR, neutrophil percentage-to-albumin ratio; SHAP, Shapley Additive exPlanations.
SHAP analysis of model feature importance and interactions. ( a ) Summary plot of SHAP values showing the impact of features on the model output, where feature values are colored from low (blue) to high (pink). ( b ) Scatter plots for selected features (MONO%, PLT, PAR, NPAR, and LMR) showing the relationship between SHAP and feature values, with LOWESS curves indicating trends and interaction points. Family PIR, family poverty income ratio; BMI, body mass index; LYM%, lymphocyte percent; LYM, lymphocyte number; MONO%, monocyte percent; PLT, platelet count; CRP, c-reactive protein; PLR, platelet-to-lymphocyte ratio; LMR, lymphocyte-to-monocyte ratio; NPR, neutrophil-to-platelet ratio; PAR, platelet-to-albumin ratio; CAR, CRP-to-albumin ratio; CLR, CRP-to-lymphocyte ratio; CALLY, CRP-albumin-lymphocyte index; NPAR, neutrophil percentage-to-albumin ratio; SHAP, Shapley Additive exPlanations.
We fitted models for the five inflammatory markers discussed earlier to further investigate the linear or non-linear relationships between the SHAP values and feature concentrations (Fig. 3 b). A positive correlation was observed between MONO% and SHAP values, which increased steadily until approximately 7.12, after which the effect plateaued. PLT exhibited a non-linear relationship, with SHAP values reaching zero at concentrations of 247.38 and 309.67, indicating pivotal thresholds in the model’s output influence. PAR displayed a U-shaped relationship with the SHAP values, which were zero at PAR concentrations of 5.22 and 10.56. NPAR and LMR revealed non-linear associations. Specifically, NPAR remained relatively stable between 0.8 and 1.2, with a slight decreasing trend, followed by a gradual increase. SHAP values reach zero at NPAR concentrations of 1.53 and 1.93. Similarly, LMR exhibits a stable trend between 1 and 3, followed by a slight upward trend and a gradual increase. The SHAP values were zero at LMR concentrations of 4.06 and 6.36. Furthermore, the non-linear relationships observed for PLT, PAR, NPAR, and LMR are consistent with the trends depicted in the SHAP feature importance plot. These findings underscore the complexity of the key feature contributions to the endometriosis prediction model and their complex influences on the model’s output. Supplementary Fig. 2 shows the SHAP fitting curves for other inflammatory factors.
Figure 4 presents the SHAP interaction analysis between MONO% and race. The heatmap on the left highlights significant correlations among key predictive factors, including MONO% and race, with the strongest correlation between MONO% and race. Although a statistical interaction between MONO% and race was detected by the SHAP analysis, its practical impact on the overall prediction performance was minimal, suggesting a limited synergistic contribution between these two features for risk prediction in this model. Figure 4 a provides a detailed visualization of the interaction between MONO% and race, with the SHAP interaction values stratified by race. The predictive contribution of MONO% differed significantly across the racial groups. For instance, Mexican Americans exhibit higher interaction values at intermediate MONO% levels, whereas non-Hispanic whites display relatively consistent SHAP interaction values across the entire MONO% range. These findings underscore the complex interactions between the key features and their collective influence on the predictive model. Additional interactions among features, including Age–MONO%, BMI–PAR and NPAR–LMR are illustrated in Supplementary Fig. 3, while further interactions such as MONO%–NPAR and PLT–race are detailed in Supplementary Fig. 4.
Fig. 4 SHAP interaction analysis of features. ( a ) Correlation heatmap of key features, showing relationships and interaction strength. ( b ) SHAP interaction dependence plot of MONO% and race, illustrating their combined effect on model predictions. ( c ) Detailed SHAP interaction values for MONO% and race, highlighting variations across racial groups. Race is categorized as 0 (Non-Hispanic White), 1 (Non-Hispanic Black), 2 (Mexican American), 3 (Other Hispanic), and 4 (Other Race). SHAP, Shapley Additive exPlanations; MONO%, monocyte percent; PLT, platelet count; BMI, body mass index; PAR, platelet-to-albumin ratio; NPAR, neutrophil percentage-to-albumin ratio; LMR, lymphocyte-to-monocyte ratio.
SHAP interaction analysis of features. ( a ) Correlation heatmap of key features, showing relationships and interaction strength. ( b ) SHAP interaction dependence plot of MONO% and race, illustrating their combined effect on model predictions. ( c ) Detailed SHAP interaction values for MONO% and race, highlighting variations across racial groups. Race is categorized as 0 (Non-Hispanic White), 1 (Non-Hispanic Black), 2 (Mexican American), 3 (Other Hispanic), and 4 (Other Race). SHAP, Shapley Additive exPlanations; MONO%, monocyte percent; PLT, platelet count; BMI, body mass index; PAR, platelet-to-albumin ratio; NPAR, neutrophil percentage-to-albumin ratio; LMR, lymphocyte-to-monocyte ratio.
To simplify the model and prioritize key indicators, we selected nine variables with the highest contributions to the model—age, race, MONO%, PLT, BMI, PAR, NPAR, LMR, and education—to construct the final predictive model. This model was subsequently validated to assess its predictive performance. Supplementary Fig. 5 illustrates the performance of the XGBoost model in predicting endometriosis. Supplementary Fig. 5a indicates the discriminative ability of the model, with an AUC of 0.85, indicating strong predictive performance. Supplementary Fig. 5b presents the classification outcomes, showing 774 true negatives, 36 false negatives, 24 true positives, and no false positives. These results suggest that the simplified model retains strong reliability and high sensitivity. An interactive web-based tool ( https://endometriosis-predictor.onrender.com ) was developed to allow users to input these variables and obtain real-time predictions of endometriosis risk.
Discussion
Despite the recent growing interest in the early diagnosis of endometriosis, research on the application of routine blood markers for endometriosis remains limited. Chen et al. demonstrated that integrating hemoglobin, CA199, CA125, and human epididymis protein 4 achieved 85.4% sensitivity and 78.83% specificity, with an AUC of 0.900, surpassing single biomarkers 12 . Another investigation highlighted elevated NLR and MPV levels alongside reduced LMR, suggesting their diagnostic potential 5 . Elevated serum interleukin-6 (IL-6), monocyte chemoattractant protein 1 (MCP-1), and interferon-gamma levels were observed, with IL-6 showing 71% sensitivity and 66% specificity. 6 Agic et al. identified increased C-C Motif Chemokine Receptor 1 messenger RNA, MCP-1, and CA125 levels, yielding 92.2% sensitivity and 81.6% specificity, underscoring their diagnostic utility 13 . Although these studies highlight the non-invasive diagnostic potential of integrating blood biomarkers, a significant gap remains in research focusing on the integration of these biomarkers to predict endometriosis risk with high accuracy.
Demographic factors, such as age, BMI, and race, have been shown to influence endometriosis risk 9 – 11 . However, the integration of these factors with inflammatory indices in predictive frameworks remains underexplored. This study developed a predictive model incorporating easily accessible variables, including age, race, MONO%, PLT, BMI, PAR, NPAR, LMR, and education. By integrating demographic data and inflammatory biomarkers, this model provides an innovative, accurate, and cost-effective tool for predicting endometriosis risk.
Inflammatory and immune dysregulation plays a key role in endometriosis pathogenesis 14 . During tissue repair, circulating monocytes migrate to the endometrium, differentiating into macrophages that aid in functional layer regeneration, angiogenesis, and gland remodeling 15 , 16 . These macrophages also secrete matrix metalloproteinases (MMPs) (e.g., MMP-12, MMP-9, and MMP-14), facilitating endometrial shedding and promoting lesion growth, angiogenesis, and neurogenesis 17 – 19 . Monocyte recruitment, driven by MCP-1, leads to immune cell accumulation in ectopic tissues, intensifying local inflammation and tissue damage 20 . MCP-1 further activates the integrin-linked kinase pathway, enhancing cell migration, adhesion, and invasion, which amplifies macrophage and monocyte infiltration 21 . Our study identified a positive association between monocyte levels and endometriosis risk, underscoring the pivotal role of monocytes in endometriosis onset and progression.
Platelets also play a significant role in endometriosis progression 22 . Stromal cells from endometriotic lesions release thrombin, thromboxane A2, thromboxane B2, and transforming growth factor-beta 1, which activate and aggregate platelets, driving inflammation and lesion growth 23 . Our SHAP interaction analysis revealed a non-linear relationship between platelet count and endometriosis risk, in contrast to previous studies. Changes within the normal platelet range may have complex effects on disease progression, suggesting the need for further research to elucidate the mechanisms of platelet function across various platelet ranges.
PAR, NPAR, and LMR are emerging inflammatory biomarkers with potential predictive advantages over traditional indices. While research on these markers’ association with endometriosis risk is limited, they have been linked to the severity and prognosis of various inflammatory conditions. For instance, PAR correlates with disease activity in axial spondyloarthritis and serves as a predictor of mortality in patients with severe fever with thrombocytopenia syndrome and peritoneal dialysis 24 . Similarly, NPAR predicts outcomes in acute kidney injury, cardiogenic shock, myocardial infarction, and non-alcoholic fatty liver disease 25 – 27 . LMR is associated with inflammatory diseases such as acute ischemic stroke, colorectal cancer, and gastric cancer 28 – 30 .
In recent years, ML has been increasingly used for the diagnosis of endometriosis by leveraging transcriptomic, imaging, and clinical data. Xie et al. 31 identified TNFSF12, AP3M1, and PDK2 as key biomarkers through transcriptomic analysis and Mendelian randomization, achieving high diagnostic accuracy (AUC = 0.90). Zhang et al. 32 used 11 ML algorithms on GSE51981 to select a five-gene panel— FOS , EPHX1 , DLGAP5 , PCSK5 , and ADAT1 —with AUCs > 0.78 in external validations. Polack et al. 33 further showed the utility of ML in large-scale multi-omic biomarker discovery relevant to endometriosis.
While these studies demonstrate the potential of ML in this field, many rely on high-dimensional omics or imaging data, which are costly and difficult to implement in routine clinical practice. In contrast, our study integrated multiple variables to construct a comprehensive model for accurately assessing endometriosis risk compared to previous studies that focused on individual biomarkers. A notable advantage of our model is its reliance on easily obtainable routine blood parameters to deliver a robust predictive performance. These variables, derived from routine blood tests and demographic data, are highly practical and clinically feasible. They are readily available during routine medical checkups without additional testing or costs, making the model applicable to most clinical settings, particularly in resource-limited regions. Furthermore, the XGBoost algorithm ensured a high model fit, achieving an AUC of 0.87, indicating excellent diagnostic accuracy. The predictive model was translated into an interactive web-based application. By inputting basic patient information, such as age, BMI, race, MONO%, and PLT, clinicians can obtain real-time predictions of endometriosis risk. Overall, this tool may shorten diagnostic wait times and improve efficiency, particularly in resource-constrained environments.
Despite its promising findings, this study has a few limitations. First, the model has not yet undergone external validation in independent datasets. Consequently, its generalizability to other populations and healthcare settings remains uncertain. Future studies should aim to externally validate the model across multiple centers, geographic regions, and ethnic groups to enhance its robustness and applicability. Second, the current model includes only demographic and routine inflammatory biomarkers, without incorporating potentially important variables such as hormonal levels, genetic predisposition, or lifestyle factors. This may limit its ability to fully capture the complex pathophysiology of endometriosis. Moreover, although the model demonstrated good sensitivity and overall accuracy, its specificity remains suboptimal. This could lead to a considerable proportion of false-positive predictions, resulting in unnecessary anxiety or resource burden in clinical practice. Therefore, the model is more suitable as a screening tool to identify individuals at elevated risk of endometriosis, rather than serving as a standalone diagnostic method. Its optimal use may be in conjunction with other clinical assessments to maximize diagnostic value.
In conclusion, this study underscores the potential of inflammatory biomarkers and demographic features in predicting endometriosis risk, identifying significant associations between endometriosis, various inflammatory biomarkers, and demographic characteristics. By integrating MONO%, PLT, PAR, NPAR, LMR, and other accessible variables into a ML-based predictive model, we provide a promising framework for improving diagnosis, with the model demonstrating strong diagnostic performance. The SHAP analysis employed in this study offers interpretability for the model’s predictive processes, highlighting key features that significantly influenced the prediction outcomes. This model has the potential to enhance clinical diagnostic efficiency, support personalized treatment and intervention strategies, and improve the management of endometriosis. Future research should focus on validating this model in more diverse cohorts and exploring its integration with other diagnostic methods to further enhance its clinical utility.