Skip to main content
Advertisement
Browse Subject Areas
?

Click through the PLOS taxonomy to find articles in your field.

For more information about PLOS Subject Areas, click here.

  • Loading metrics

An exploratory machine learning study on paediatric abdominal pain phenotyping and prediction

  • Kazuya Takahashi ,

    Roles Conceptualization, Formal analysis, Funding acquisition, Writing – original draft

    kazuya911@med.niigata-u.ac.jp

    Affiliations Centre for Neuroscience and Trauma, Wingate Institute of Neurogastroenterology, Blizard Institute, Barts and The London School of Medicine and Dentistry, Queen Mary University of London, London, United Kingdom, Division of Gastroenterology and Hepatology, Graduate School of Medical and Dental Sciences, Niigata University, Niigata, Japan

  • Michalina Lubiatowska,

    Roles Writing – review & editing

    Affiliation Centre for Neuroscience and Trauma, Wingate Institute of Neurogastroenterology, Blizard Institute, Barts and The London School of Medicine and Dentistry, Queen Mary University of London, London, United Kingdom

  • Huma Shehwana,

    Roles Formal analysis, Writing – review & editing

    Affiliation Department of Biological Sciences, National University of Medical Sciences, Rawalpindi, Pakistan

  • James K. Ruffle,

    Roles Supervision, Writing – review & editing

    Affiliations Centre for Neuroscience and Trauma, Wingate Institute of Neurogastroenterology, Blizard Institute, Barts and The London School of Medicine and Dentistry, Queen Mary University of London, London, United Kingdom, Queen Square Institute of Neurology, University College London, London, United Kingdom

  • John A. Williams,

    Roles Supervision, Writing – review & editing

    Affiliations College of Medical and Dental Sciences, Institute of Cancer and Genomic Sciences, University of Birmingham, Birmingham, United Kingdom, Health Data Research United Kingdom, Midlands Site, Birmingham, United Kingdom, Centre for Health Data Science, Birmingham, United Kingdom

  • Animesh Acharjee,

    Roles Supervision, Writing – review & editing

    Affiliations College of Medical and Dental Sciences, Institute of Cancer and Genomic Sciences, University of Birmingham, Birmingham, United Kingdom, Health Data Research United Kingdom, Midlands Site, Birmingham, United Kingdom, Centre for Health Data Science, Birmingham, United Kingdom

  • Shuji Terai,

    Roles Writing – review & editing

    Affiliation Division of Gastroenterology and Hepatology, Graduate School of Medical and Dental Sciences, Niigata University, Niigata, Japan

  • Georgios V. Gkoutos,

    Roles Supervision, Writing – original draft

    Affiliations College of Medical and Dental Sciences, Institute of Cancer and Genomic Sciences, University of Birmingham, Birmingham, United Kingdom, Health Data Research United Kingdom, Midlands Site, Birmingham, United Kingdom, Centre for Health Data Science, Birmingham, United Kingdom

  • Humayoon Satti ,

    Roles Conceptualization, Data curation, Writing – review & editing

    ‡ H.Satti and Q.Aziz are joint senior authors.

    Affiliation Department of Biological Sciences, National University of Medical Sciences, Rawalpindi, Pakistan

  • Qasim Aziz

    Roles Conceptualization, Supervision, Writing – review & editing

    ‡ H.Satti and Q.Aziz are joint senior authors.

    Affiliation Centre for Neuroscience and Trauma, Wingate Institute of Neurogastroenterology, Blizard Institute, Barts and The London School of Medicine and Dentistry, Queen Mary University of London, London, United Kingdom

Abstract

Background

The exact mechanisms underlying paediatric abdominal pain (AP) remain unclear due to patient heterogeneity. This preliminary study aimed to identify AP phenotypes and develop predictive models to explore associated factors, with the goal of guiding future research.

Methods

In 13,790 children from a large birth cohort, data on paediatric and maternal demographics and comorbidities were extracted from general practitioner records. Machine learning (ML) clustering was used to identify distinct AP phenotypes, and an ML-based predictive model was developed using demographics and clinical features.

Results

1,274 children experienced AP (9.2%) (average age: 8.4 ± 1.1 years, male/female: 615/659), who clustered into three distinct phenotypes: Phenotype 1 with an allergic predisposition (n = 137), Phenotype 2 with maternal comorbidities (n = 676), and Phenotype 3 with minimal other comorbidities (n = 340). As the number of allergic diseases or maternal comorbidities increased, so did the frequency of AP, with 17.6% of children with ≥ 3 allergic diseases and 25.6% of children with ≥ 3 maternal comorbidities. The predictive model demonstrated moderate performance in predicting paediatric AP (AUC 0.67), showing that a child’s ethnicity, paediatric allergic diseases, and maternal comorbidities were key predictive factors. When stratified by ML-predicted probability, observed AP rates were 18.9% in the < 40% group, 44.8% in the 40–50% group, 60.6% in the 50–60% group, and 100.0% in the > 60% group.

Conclusions

This study identified distinct AP phenotypes and key risk factors using ML. Furthermore, the predictive ML model enabled risk stratification for paediatric AP. These analyses provide valuable insights to guide future investigations into the mechanisms of AP and may facilitate research aimed at identifying targeted interventions to improve patient outcomes.

1. Introduction

Abdominal pain (AP) is one of the most common symptoms among children and adolescents, with prevalence rates across the USA and Europe ranging from 0.3% to 19.0% [13]. In primary care, children presenting with AP are diagnosed with functional or medically un-explained AP in 80% of the cases, while organic causes are considerably less frequent [4,5]. Although rarely life-threatening, AP is often refractory to treatment and associated with psychiatric comorbidities, such as anxiety and depressive disorders [6], significantly affecting health-related quality of life [7]. Therefore, early recognition and intervention are warranted.

Organic diseases, as well as early life events ranging from allergy status, psychological comorbidity, and parental factors, are proposed risk factors for paediatric AP [5,810]. Moreover, these diverse risk factors can interact, contributing to its complexity and heterogeneity. A more robust stratification with large patient cohorts is essential for understanding the aetiology of paediatric AP, plausibly disclosing novel insights into its underlying mechanisms.

A robust approach for identifying subgroups of patients with shared characteristics is data-driven clustering by unsupervised machine learning (ML) [11,12]. Any yielded subgroups may share an underlying mechanism associated with AP. Furthermore, supervised ML is considered a powerful tool for clinical outcome prediction [13], and it could aid clinicians in assessing the risk of AP development in early childhood [14]. Based on this background, we hypothesised that an ML algorithm could classify children with AP into distinct phenotypes based on common characteristics, thereby helping to unravel the complex underlying AP mechanisms. Additionally, we hypothesised that ML algorithms could predict the development of paediatric AP and help identify the key factors associated with it.

In this exploratory study, we comprehensively evaluated the risk factors of paediatric patients with AP in a large birth cohort, covering a broad spectrum of cases. Using unsupervised ML, we delineated phenotypes of paediatric AP using paediatric and maternal clinical data. Moreover, supervised ML models tasked to predict the development of paediatric AP uncovered underlying factors linked to its frequency. These complementary methods may serve as a catalyst for future research.

2. Materials and Methods

2.1. Participants

Between 2007 and 2011, 12,453 pregnant women (recruited at 26–28 weeks) and 13,858 children were registered in the Born in Bradford (BiB) cohort. The detailed demographics of the whole cohort are described elsewhere [15]. Data for this study were accessed for research purposes between November 2020 and December 2024 under a data sharing agreement. All data were fully pseudonymised before being accessed by the research team. Written informed consent was obtained from mothers at the time of cohort enrolment. For this study, we included children who had linked general practitioner (GP) records and whose comorbidities could be identified using the systematized nomenclature of medicine clinical terms (SNOMED-CT), a standardized terminology system used in medicine and healthcare. The details of the study population are illustrated in Fig 1. Ethical approval was obtained from the Bradford Research Ethics Committee (Ref: 07/H1302/112). This study was conducted following the principles of the Declaration of Helsinki.

thumbnail
Fig 1. Study population.

Among 13,858 children in the Born in Bradford cohort, 13,790 with linked general practitioner (GP) records were included. Study 1 identified factors associated with paediatric abdominal pain (AP) using propensity score matching (1:2 ratio). Study 2 performed phenotyping of AP using unsupervised machine learning (ML) clustering. Study 3 developed predictive models using supervised ML, including 1,274 children with AP and 1,274 randomly selected children without AP (1:1 ratio).

https://doi.org/10.1371/journal.pone.0336215.g001

2.2. Definition of AP and frequency survey of paediatric and maternal comorbidities

AP was defined as the presence of one of the following diagnoses in SNOMED-CT: AP, abdominal wall pain, or generalized AP. The frequencies of comorbidities, such as gastrointestinal (GI), psychological, and allergic diseases (asthma, eczema, urticaria, or hay fever), as well as diseases causing somatic pain, were also retrieved using SNOMED-CT, since these are associated with both organic and functional AP [8,10,1618]. Additionally, the comorbidities of the children’s genetic mothers were extracted to identify any associations between the maternal comorbidities and paediatric AP. The diseases of the children and their mothers investigated in this study and their SNOMED-CT codes are listed in S1 Table. Fathers were not included in our analysis pipeline due to a significant proportion of missing values.

2.3. Study 1. Identifying factors associated with paediatric AP

Study 1 aimed to determine the frequency of AP, elucidate the clinical characteristics of children with AP, and identify its associated factors. First, to adjust for background differences at the time of extraction between children with and without AP, we employed propensity score matching. After matching, we compared the two matched groups to assess differences in demographics and the frequency of comorbidities.

Next, we identified factors associated with paediatric AP. For this analysis, all comorbidities listed in S1 Table were included, irrespective of whether they occurred before or after the onset of AP, as the aim was to examine their overall association with paediatric AP.

2.4. Study 2. Phenotyping paediatric AP using unsupervised ML clustering

Study 2 focused on children experiencing AP, using unsupervised ML clustering to delineate phenotypes. The rationale for adopting unsupervised ML was to allow the algorithm to identify groups of children with similar characteristics from a large number of variables, minimizing human bias and thereby enabling the discovery of previously unrecognized phenotypes of paediatric AP. We considered this approach valuable as a potential foundation for future research.

In Python (version 3.7.12) [19], Uniform Manifold Approximation and Projection (UMAP), a non-linear dimensionality reduction technique, was applied to embed all variables into a three-dimensional latent space for subsequent clustering [20]. UMAP preserves both the local and global structure of high-dimensional data, placing data points with similar characteristics close to each other and thereby facilitating visual interpretation. A scatterplot was then generated from the latent features, and phenotypic AP clusters were identified using Hierarchical Density-based Spatial Clustering of Applications with Noise (HDBSCAN), a density-based hierarchical method [21]. HDBSCAN does not require a predefined number of clusters and is well suited for data with variable cluster densities. It produces a hierarchy of candidate clusters and selects the most stable ones, thereby yielding robust and reproducible clusters even in noisy datasets. The hyperparameters of UMAP and HDBSCAN used for clustering (settings that control how many clusters are found and how tightly the points are grouped) were summarized in S2 Table. Furthermore, to illustrate the hierarchical structure of the identified phenotypes, we adopted the condensed tree representation of HDBSCAN. This visualization allows the identification of cluster stability and the relative density distribution of each phenotype, providing insight into how clusters persist or split across different density thresholds [22].

Demographics and comorbidities of both children and their mothers were subsequently compared across the identified phenotypes to elucidate their distinct characteristics. Furthermore, we investigated whether the number of significant comorbidities identified in the phenotype analysis was associated with the frequency of paediatric AP.

2.5. Study 3. Using supervised ML to predict the development of paediatric AP

Supervised ML was used to predict paediatric AP. Supervised ML is useful for predicting the occurrence of clinical outcomes based on known labels — in this case, the presence or absence of AP — and has been widely applied for outcome prediction in previous studies [23,24]. Furthermore, by examining the variables used in the predictive model, clinically relevant factors associated with the outcome can be identified.

To prepare the data for model development, we constructed a balanced dataset by randomly selecting an equal number of children without AP from the control group to match those with AP (Fig 1), thereby mitigating potential model bias due to class imbalance. Predictive variables included demographic information and pre-existing comorbidities diagnosed prior to the onset of AP. Comorbidities with a prevalence of less than 1% were excluded to reduce the risk of model overfitting. The variables used in the predictive model, along with their frequencies in children with and without AP, are summarised in S3 Table. The overall workflow for model development is illustrated in S1 Fig.

We initially developed predictive models for paediatric AP using several ML algorithms, including eXtreme Gradient Boosting, Categorical Boosting (CatBoost), Light Gradient Boosting Machine, and Random Forest. Model performance was assessed using receiver operating characteristic (ROC) curves and the corresponding area under the curve (AUC). In addition, accuracy, sensitivity, specificity, positive predictive value (PPV), and negative predictive value (NPV) were calculated. The model with the highest AUC was selected for subsequent feature importance analysis and risk stratification.

To interpret model predictions, we employed Shapley Additive exPlanations (SHAP) values. SHAP quantifies the contribution of each feature to individual predictions, allowing us to identify which variables had the greatest influence on the model’s outputs and to enhance interpretability [25,26].

Finally, because the ML models produce continuous probability estimates for AP, we stratified children in the test dataset into four probability groups: < 40%, 40–50%, 50–60%, and >60%. The observed risk of paediatric AP was then compared across these strata.

2.6 Statistical analysis

Continuous data were expressed as mean ± standard deviation (SD). Categorical data were expressed as numbers and percentages. The Student’s t-test and Chi-squared test were used for numerical and categorical data, respectively.

To compare children with AP and those without, the propensity score was calculated using logistic regression analysis, with age at extraction and gender as covariates. Matched children with and without AP were then extracted. A 1:2 nearest-neighbour matching without replacement was performed, with a calliper width set to 0.2 times the standard deviation of the logit of the propensity score. Model discrimination was assessed using the c-statistic, and covariate balance was evaluated using standardized mean differences (SMDs), with SMD < 0.1 indicating good balance.

Univariate and multivariate logistic regression analyses were utilised to calculate odds ratios (ORs) and 95% confidence intervals (CI) for each variable, determining variables associated with paediatric AP. Variables significant in the univariate analysis were included in the multivariate analysis. As the comparisons between phenotypes were descriptive and intended to characterize group differences, Bonferroni correction was not applied. The Wald test was applied to compare ORs among the predicted probability groups. A p-value < 0.05 was considered statistically significant. EZR (Saitama Medical Center, Jichi Medical University, Saitama, Japan) was used for statistical analysis [27].

3. Results

3.1. Study 1. Identifying factors associated with paediatric AP

Summary: Paediatric AP was observed in 9.2% of children. Those with AP had more paediatric and maternal comorbidities. Key associated factors included Pakistani ethnicity, allergic and GI diseases, migraine, as well as maternal AP, allergic diseases, GORD, and migraine.

A total of 13,790 children were included in the analysis, of whom 1,274 (9.2%) experienced AP (male/female = 615/659). The average age at diagnosis of AP was 5.6 ± 2.7 years. The characteristics of all children are summarised in S4 Table.

As a result of propensity score matching, 1,239 children with AP and 2,478 children without AP were selected (Table 1). Compared to children without AP, more children of Pakistani origin were in the AP group, while fewer were of White origin (all p < 0.01). Children with AP had higher rates of comorbidities, including allergic diseases, appendicitis, Celiac disease, constipation, and gastro-oesophageal reflux disease (GORD), and migraine (all p < 0.01). Moreover, mothers of children with AP reported higher incidences of AP, allergic diseases, arthritis, chronic muscle pain, functional dyspepsia, GORD, irritable bowel syndrome (IBS), and migraine (all p < 0.01).

thumbnail
Table 1. Comparison of children with and without abdominal pain.

https://doi.org/10.1371/journal.pone.0336215.t001

Multivariate logistic regression analysis revealed that Pakistani ethnicity, allergic diseases, GI diseases, migraine, maternal AP, maternal allergic diseases, maternal GORD, and maternal migraine were significantly associated with paediatric AP (Table 2). Non–significant results are summarized in S5 Table.

thumbnail
Table 2. Significant results of logistic regression analysis for the diagnosis of paediatric abdominal pain.

https://doi.org/10.1371/journal.pone.0336215.t002

3.2 Study 2. Phenotyping children using unsupervised ML clustering

Summary: Unsupervised ML clustering identified three phenotypes of paediatric AP, characterized mainly by allergic diseases and maternal comorbidities. The risk of AP increased with the number of allergic diseases and maternal comorbidities, suggesting an additive effect.

The unsupervised model classified children with AP into three distinct phenotypes: 137 children in Phenotype 1 (10.8%), 677 children in Phenotype 2 (53.1%), and 340 children in Phenotype 3 (26.7%) (Fig 2A). The remaining 120 children (9.4%) exhibited miscellaneous characteristics, making them unclassifiable by the model; these children were excluded from downstream analyses.

thumbnail
Fig 2. Phenotyping of children with abdominal pain.

A. Scatter plots based on three new variables generated by unsupervised Uniform Manifold Approximation and Projection (UMAP). Hierarchical Density-Based Spatial Clustering of Applications with Noise (HDBSCAN) found 3 distinct phenotypes. B. Hierarchical structure of identified phenotypes (Condensed Tree). The vertical axis (λ value = 1/ε, density scale) represents the density scale used by the HDBSCAN algorithm. HDBSCAN performs hierarchical clustering by varying the distance threshold that defines neighborhood connectivity (ε). Smaller ε (larger λ) corresponds to higher-density regions, while larger ε (smaller λ) represents broader, lower-density structures. Clusters that persist across a wider range of λ values (longer vertical branches) indicate more stable and well-defined groups. The horizontal axis shows the cluster hierarchy, corresponding to different cluster branches identified by HDBSCAN. Each branch represents a cluster that emerges and persists across density thresholds. The color of each branch indicates the number of data points (cluster size), as shown in the color bar on the right. C. Scatter plots color-coded by representative variables. Each plot is colored according to the representative variables that characterize the three phenotypes.

https://doi.org/10.1371/journal.pone.0336215.g002

The condensed tree visualization (Fig 2B) revealed that Phenotype 1, located on the left, was smaller but highly stable, representing a dense and well-separated cluster. Phenotype 2, on the right, formed the largest and stable branch, suggesting a large, cohesive subgroup. Phenotype 3, positioned in the middle, appeared moderately dense and less stable, indicating a more diffuse structure. Overall, these hierarchical relationships underscore the robustness of the clustering process and the distinct density profiles among the identified phenotypes.

To further illustrate phenotypic characteristics, color-coded plots of representative pediatric and maternal comorbidities were generated (Fig 2C).

Subsequently, we compared the clinical characteristics among the three phenotypes (Table 3). Age at diagnosis of AP, gender, route of birth, and ethnicity showed almost no significant differences among the three phenotypes. The frequency of GI disorders was low in all phenotypes and showed few significant differences between the phenotypes. The clinical characteristics of each phenotype are summarised below.

thumbnail
Table 3. Comparison of clinical characteristics among 3 pain phenotypes.

https://doi.org/10.1371/journal.pone.0336215.t003

Phenotype 1.

Most children in Phenotype 1 had allergic diseases (99.3%), and all mothers had allergic diseases (100%), which were significantly higher than in Phenotypes 2 and 3 (p < 0.01). In short, this phenotype was characterized as ‘AP with allergic predisposition’, suggesting relevance of allergic mechanisms in AP development in children.

Phenotype 2.

In this phenotype, the frequency of allergic diseases is relatively high at 68.7%, but other comorbidities in the children were uncommon. In contrast, maternal comorbidities showed the highest frequencies in this phenotype: AP (70.0%), allergic diseases (40.0%), depressive and/or bipolar disorder (37.2%), GORD (18.9%), and migraine (34.0%). We termed Phenotype 2 as ‘AP with mothers’ comorbidities’.

Phenotype 3.

The frequency of mother’s AP (46.2%) was the second highest in Phenotype 3. However, the frequencies of other comorbidities, including children’s allergic diseases and other maternal comorbidities were uncommon. This phenotype was termed ‘AP with the least comorbidities’.

Impact of allergic diseases and maternal comorbidities on paediatric AP.

We further investigated the effect of allergic diseases and maternal comorbidity burdens on the frequency of paediatric AP. As the number of paediatric allergic diseases increased, the frequency of AP in children increased commensurately (Fig 3A). Specifically, 17.6% of children with ≥ 3 allergic diseases experienced AP, which was significantly more frequent than those with 0–2 allergic diseases (p < 0.01). Similarly, as the number of maternal comorbidities increased, the frequency of AP in children also increased (Fig 3B). In cases where mothers had ≥ 3 comorbidities, the frequency of paediatric AP was 25.6%, which was significantly higher than in cases with 0–2 comorbidities (p < 0.01). Furthermore, when comparing the high-risk children (those who met the criteria of having both ≥ 3 allergic diseases and ≥ 3 maternal comorbidities) to the others (control), the high-risk group had a significantly higher frequency of AP (p < 0.01) (Fig 3C).

thumbnail
Fig 3. The frequency of paediatric abdominal pain depending on the number of allergic diseases and the number of maternal comorbidities.

A–B. The bar graphs illustrate the relationship between the frequency of paediatric abdominal pain (AP) and the number of allergic diseases in children, as well as the number of comorbidities in their mothers. Error bars in the figure represent the 95% confidence intervals (CI) for the frequency of paediatric AP. C. The high-risk group is defined as children with both ≥ 3 allergic diseases and ≥ 3 maternal comorbidities while the remaining children are regarded as the control group. The frequency of AP is compared between the high-risk and control groups.

https://doi.org/10.1371/journal.pone.0336215.g003

3.3. Study 3. Development of ML predictive models for paediatric AP

Summary: The best predictive model for paediatric AP was CatBoost (AUC 0.67), which enabled moderate risk stratification. Ethnicity, especially Pakistani ethnicity, was the most important predictor, and maternal AP was the most influential maternal comorbidity.

Finally, we developed predictive models for paediatric AP. After evaluating several algorithms, CatBoost yielded the highest AUC of 0.67 (95% CI: 0.63–0.71) and was therefore selected for subsequent analyses (Fig 4A and S6 Table). The accuracy, sensitivity, specificity, PPV, and NPV of the CatBoost-based model were 0.62 (95% CI: 0.58–0.65), 0.68 (95% CI: 0.63–0.73), 0.55 (95% CI: 0.50–0.61), 0.62 (95% CI: 0.57–0.66), and 0.62 (95% CI: 0.57–0.68), respectively (Table 4).

thumbnail
Table 4. Results of predictive models for paediatric abdominal pain.

https://doi.org/10.1371/journal.pone.0336215.t004

thumbnail
Fig 4. Results of supervised machine learning predictive models for paediatric abdominal pain.

A. Receiver operating characteristic (ROC) curve of the CatBoost-based model. B. The y-axis represents the observed abdominal pain (AP) rate, while the x-axis indicates the predicted probability groups. Error bars represent the 95% confidence intervals of the observed AP rates. C. The mean Shapley Additive exPlanations (SHAP) value of each variable. Variables written in red represent maternal comorbidities, while those written in black represent variables related to the children themselves. D. The beeswarm plots show the SHAP feature importance and the direction of the effect of each variable on the model. The horizontal axis represents the SHAP value. Since all the variables used in the predictive models were binary, red and blue plots indicate positive or negative for each variable, respectively. For example, in the case of ‘Pakistani’, red plots tend to be distributed in the positive SHAP value and blue plots in the negative SHAP value. This indicates that Pakistani children are more likely to have AP.

https://doi.org/10.1371/journal.pone.0336215.g004

SHAP analysis indicated that ethnicity had a greater influence on the prediction than comorbidities, with White children being less likely and Pakistani children more likely to develop AP (Fig 4C and 4D). Maternal AP emerged as the most influential maternal comorbidity, while allergic diseases were the strongest predictor among paediatric comorbidities.

When stratified by the probability estimated by the CatBoost-based model, the observed rates of AP were 18.9%, 44.8%, 60.6%, and 100.0% in the < 40%, 40–50%, 50–60%, and >60% probability groups, respectively (Fig 4B and Table 5). Compared to the lowest-probability group (<40%), the odds of AP were significantly higher in the 40–50% group (OR 3.49, 95% CI: 1.94–6.26, p < 0.01), 50–60% group (OR 6.61, 95% CI: 3.76–11.6, p < 0.01), and >60% group (OR could not be calculated, but p < 0.01).

thumbnail
Table 5. Risk stratification of paediatric abdominal pain based on the probability predicted by the CatBoost-based ML model.

https://doi.org/10.1371/journal.pone.0336215.t005

4. Discussion

The prevalence of paediatric AP in our study cohort was 9.2%. Several child and maternal factors, including paediatric ethnicity, GI and allergic diseases, as well as maternal AP, were associated with paediatric AP. ML-based clustering successfully identified three distinct phenotypes of paediatric AP, suggesting the presence of subgroups among children with AP. The characteristics of these phenotypes indicate that allergic diseases and maternal comorbidities are relevant to the development of AP in two of the three phenotypes. The predictive performance of the ML model was moderate when using the data from GP records. The most influential determinants of paediatric AP in the predictive model were child ethnicity, allergic predisposition, and maternal comorbidities, particularly maternal AP. Taken together, our findings suggest that both unsupervised and supervised ML approaches could uncover clinically relevant factors and may serve as useful tools for hypothesis generation in future studies.

In this study, maternal GI comorbidities, such as AP and GORD, were significantly associated with paediatric AP. This finding is consistent with previous research showing that parental factors are related to functional AP in children [8,10,18]. For example, children of mothers with IBS or chronic pain tended to experience more GI symptoms or functional AP [18,28]. This association may be explained by parental influence on children’s pain experiences, whereby children may model their parents’ pain behaviours, and parents may reinforce their children’s pain complaints through solicitous responses [18,2830]. Moreover, functional GI disorders, which are common causes of AP, are influenced by genetic factors [31], suggesting that the observed association may be partly due to shared genetic predisposition between mothers and children. Our findings underscore the important link between maternal factors and paediatric AP.

The ML clustering revealed three distinct phenotypes of paediatric AP. In all phenotypes, paediatric AP were not fully explained by GI diseases. Notably, Phenotype 1 (10.8%) was characterized by the presence of allergic diseases. Previous studies have reported that functional AP is multifactorial condition, influenced not only by parental and genetic factors but also by intestinal mechanisms such as low-grade inflammation [32], psychological aspects including anxiety, visceral hypersensitivity mediated by enteric and central nervous system modulation [33], and post-infectious dysbiosis leading to disruption of the brain–gut axis [34]. Although the role of allergic mechanisms in paediatric AP remains inconclusive, early-life allergic conditions—including eczema, rhinitis, hay fever, and asthma—have been associated with an increased risk of functional GI disorders, such as IBS, later in childhood [9,17,35]. Mast cells, which play a central role in visceral hypersensitivity [36], have recently been shown to undergo localized, food-induced activation in the intestines of patients with IBS [37]. Our findings, together with these reports, generate the hypothesis that gastrointestinal neuro-immune interactions may contribute to AP in children with allergic predispositions. Indeed, a recent study demonstrated that histamine-1 receptor antagonists effectively reduced AP intensity compared with placebo in patients with non-constipated IBS [38]. While these mechanisms require further validation in future studies, they may ultimately inform the development of targeted, allergy-focused interventions for pediatric AP.

In Phenotype 2 (53.1%), where maternal comorbidities were associated, aforementioned parental mechanisms may play a role in the development of paediatric AP [18,2831]. In this subgroup, treatment strategies may need to consider not only interventions directed at the child but also parental factors, potentially including approaches such as cognitive behavioural therapy [39].

In contrast, in Phenotype 3 (26.7%), maternal AP was relatively common, occurring in 46.2% of cases. Therefore, some of the AP in children within Phenotype 3 may be explained by maternal influence. However, since the frequency of maternal comorbidities was much lower than in Phenotype 2, it is unlikely that all cases can be attributed to this factor. It is possible that the information available from GP records was insufficient to deeply phenotype children in Phenotype 3. Furthermore, 9.4% of children in this study were categorized as unclassified. With more detailed AP-related data, such as socioeconomic status, lifestyle, autonomic nervous system function, and gut microbiota composition, it may be possible to perform a deeper phenotypic analysis of children in Phenotype 3 and identify unclassified children as a distinct phenotype with specific characteristics [4042].

The CatBoost-based model achieved a moderate AUC of 0.67 and identified the child’s ethnicity as a key factor, consistent with its significance in the logistic regression model. The BiB cohort is unique in that it primarily includes children of White (29.3%) and Pakistani ethnicities (39.5%) [15]. Socioeconomic status varies by ethnicity within the cohort [43], and lower socioeconomic status is a known risk factor for pain conditions in children, including AP [44]. Furthermore, socioeconomic status is also associated with the prevalence of allergic disease, and previous studies have reported a higher prevalence of allergic diseases among children of Pakistani origin in the BiB cohort [43]. In the present dataset, the frequency of allergic diseases was significantly higher in children of Pakistani origin compared with other ethnic groups (45.1% vs. 38.9%, p < 0.01). Allergic diseases were the main characteristic of Phenotype 1 in our clustering analysis and were identified as a potential factor associated with AP. Thus, the significance of Pakistani origin in the predictive model may partly reflect the higher prevalence of allergic diseases in this group. Importantly, the use of a cohort with a high prevalence of allergic diseases may have influenced both the phenotyping and predictive modelling results, and caution is warranted when generalizing these findings to the wider population. Nevertheless, this unique cohort setting may also be regarded as a strength, as it has enabled the generation of new research questions that warrant further investigation.

Notably, approximately 60% of Pakistani couples represented in this cohort are reported to have consanguineous marriages, with 37% being first-cousin unions [45]. Children born from consanguineous marriages have been shown to have higher mortality rates and an increased number of primary care appointments compared to those born to non-consanguineous couples, indicating a higher burden of health issues [46]. Such consanguinity may also help explain why being of Pakistani ethnicity was a significant risk factor for paediatric AP in our model.

While the ML predictive model enabled a certain degree of risk stratification according to predicted probabilities, the substantial number of AP cases observed even in lower (40–50%) and intermediate (50–60%) probability groups suggests that the model’s discriminative power remains limited. This may be attributable to the fact that, although important associated factors such as allergic diseases and maternal AP were included as predictors in the ML model, variables directly reflecting the underlying pathophysiology of AP were not incorporated. Future models may benefit from incorporating variables that capture the underlying pathophysiology of AP, such as visceral hypersensitivity, altered gut-brain signalling, dysbiosis, and subclinical intestinal inflammation [4749].

Our study is not without limitations. First, we were unable to clearly distinguish between chronic and acute AP due to the limited temporal detail in the available GP records. However, given the rarity of organic diseases that typically cause acute AP, the majority of cases were presumed to be chronic. While this limits the precision of phenotype classification, it reflects real-world clinical practice where such distinctions are not always made or documented clearly. Moreover, the identified risk factors–such as allergic predisposition– are likely relevant to both types of AP, as supported by previous literature [17,50]. Most of our findings are also consistent with prior studies, lending support to the credibility and reliability of the data [40]. Therefore, despite this limitation, our findings provide valuable insights into the broader mechanisms of paediatric AP and remain relevant for understanding its development. Second, at the GP level, the exact cause of AP might not always be identifiable. Therefore, the criteria used for each diagnosis and the exact causes of AP in each case are unknown and was beyond our control. However, functional AP is likely the predominant cause, as previous community-based studies of AP in children suggest that approximately 80% of cases are classified as functional or non-medically explained, whereas organic diseases account for only 5–10% of cases [42]. Despite its complexity, real-world data of this nature holds significant potential for generating valuable insights, particularly when analysed using advanced methods such as ML [51]. Finally, although we evaluated the performance of our predictive models in an out-of-sample test partition, we did not fully validate them using a different cohort of children, which would further maximize generalizability. Moreover, a different cohort would also be useful for verifying the reproducibility of clustering. As this was an exploratory study, further research is warranted to examine the identified factors in greater detail.

In conclusion, our exploratory study identified paediatric and maternal comorbidities as significant associated factors for paediatric AP. By applying data-driven clustering techniques, we delineated three distinct phenotypes of paediatric AP. These findings may lay the groundwork for future research aimed at clarifying the underlying pathophysiological mechanisms, validating these results in more diverse populations, and exploring potential genetic and environmental contributors. The predictive models developed in this study highlight the potential for early identification and intervention. Further studies incorporating more detailed data could refine phenotyping and predictive models, leading to more accurate predictions and paving the way for optimised, patient-personalised treatment strategies.

Supporting information

S1 Fig. Workflow for developing predictive models.

The entire dataset was randomly partitioned into 70% for model training and 30% for out-of-sample testing. Using the training data, we trained predictive models. Grid-search with 10-fold cross-validation was employed to tune the hyperparameters of each model using the training dataset. The training dataset was divided into 10 folds. Nine folds were used as the training dataset, and the remaining one-fold was used as the validation dataset. This process was repeated 10 times to optimize the hyperparameters of each predictive model. The performance of each model was evaluated using the test dataset.

https://doi.org/10.1371/journal.pone.0336215.s001

(PDF)

S1 Table. Investigated diseases and their corresponding systematized nomenclature of medicine clinical terms (SNOMED-CT) codes.

https://doi.org/10.1371/journal.pone.0336215.s002

(DOCX)

S2 Table. Hyperparameters of UMAP and HDBSCAN.

https://doi.org/10.1371/journal.pone.0336215.s003

(DOCX)

S3 Table. Frequency of variables used in machine learning predictive models.

https://doi.org/10.1371/journal.pone.0336215.s004

(DOCX)

S4 Table. Characteristics of all children (N = 13,790).

https://doi.org/10.1371/journal.pone.0336215.s005

(DOCX)

S5 Table. Non–significant results of logistic regression analysis for the diagnosis of paediatric abdominal pain.

https://doi.org/10.1371/journal.pone.0336215.s006

(DOCX)

S6 Table. Results of predictive models for paediatric abdominal pain using various machine learning algorithms.

https://doi.org/10.1371/journal.pone.0336215.s007

(DOCX)

References

  1. 1. Chitkara DK, Rawat DJ, Talley NJ. The epidemiology of childhood recurrent abdominal pain in Western countries: a systematic review. Am J Gastroenterol. 2005;100(8):1868–75. pmid:16086724
  2. 2. Korterink JJ, Diederen K, Benninga MA, Tabbers MM. Epidemiology of pediatric functional abdominal pain disorders: a meta-analysis. PLoS One. 2015;10(5):e0126982. pmid:25992621
  3. 3. Devanarayana NM, de Silva DGH, de Silva HJ. Recurrent abdominal pain syndrome in a cohort of Sri Lankan children and adolescents. J Trop Pediatr. 2008;54(3):178–83. pmid:18204085
  4. 4. Vila M, Kramer T, Obiols JE, Garralda ME. Abdominal pain in British young people: associations, impairment and health care use. J Psychosom Res. 2012;73(6):437–42. pmid:23148811
  5. 5. Spee LAA, van den Hurk APJM, van Leeuwen Y, Benninga MA, Bierma-Zeinstra SMA, Passchier J, et al. Childhood abdominal pain in primary care: design and patient selection of the HONEUR abdominal pain cohort. BMC Fam Pract. 2010;11:27. pmid:20377856
  6. 6. Dufton LM, Dunn MJ, Compas BE. Anxiety and somatic complaints in children with recurrent abdominal pain and anxiety disorders. J Pediatr Psychol. 2009;34(2):176–86. pmid:18577541
  7. 7. Warschburger P, Hänig J, Friedt M, Posovszky C, Schier M, Calvano C. Health-related quality of life in children with abdominal pain due to functional or organic gastrointestinal disorders. J Pediatr Psychol. 2014;39(1):45–54. pmid:24055816
  8. 8. Korterink J, Devanarayana NM, Rajindrajith S, Vlieger A, Benninga MA. Childhood functional abdominal pain: mechanisms and management. Nat Rev Gastroenterol Hepatol. 2015;12(3):159–71. pmid:25666642
  9. 9. Sjölund J, Kull I, Bergström A, Järås J, Ludvigsson JF, Törnblom H, et al. Allergy-related diseases in childhood and risk for abdominal pain-related functional gastrointestinal disorders at 16 years-a birth cohort study. BMC Med. 2021;19(1):214. pmid:34526042
  10. 10. Zeevenhooven J, Rutten JMTM, van Dijk M, Peeters B, Benninga MA. Parental factors in pediatric functional abdominal pain disorders: a cross-sectional cohort study. J Pediatr Gastroenterol Nutr. 2019;68(2):e20–6. pmid:30289821
  11. 11. Ruffle JK, Farmer AD, Aziz Q. Artificial Intelligence-Assisted Gastroenterology — Promises and Pitfalls. Am J Gastroenterol. 2019;114:422–8.
  12. 12. Ko S, Pareek A, Jo C, Han H-S, Lee MC, Krych AJ, et al. Automated risk stratification of hip osteoarthritis development in patients with femoroacetabular impingement using an unsupervised clustering algorithm: a study from the rochester epidemiology project. Orthop J Sports Med. 2021;9(11). pmid:34778477
  13. 13. Takahashi K, Sato H, Shimamura Y, Abe H, Shiwaku H, Shiota J, et al. Achalasia phenotypes and prediction of peroral endoscopic myotomy outcomes using machine learning. Dig Endosc. 2024;36(7):789–800. pmid:37886891
  14. 14. Bravo-Merodio L, Acharjee A, Russ D, Bisht V, Williams JA, Tsaprouni LG, et al. Translational biomarkers in the era of precision medicine. Adv Clin Chem. 2021;102:191–232. pmid:34044910
  15. 15. Wright J, Small N, Raynor P, Tuffnell D, Bhopal R, Cameron N, et al. Cohort Profile: the Born in Bradford multi-ethnic family cohort study. Int J Epidemiol. 2013;42(4):978–91. pmid:23064411
  16. 16. Spee LAA, Lisman-Van Leeuwen Y, Benninga MA, Bierma-Zeinstra SMA, Berger MY. Prevalence, characteristics, and management of childhood functional abdominal pain in general practice. Scand J Prim Health Care. 2013;31(4):197–202. pmid:24106821
  17. 17. Olén O, Neuman Å, Koopmann B, Ludvigsson JF, Ballardini N, Westman M, et al. Allergy-related diseases and recurrent abdominal pain during childhood - a birth cohort study. Aliment Pharmacol Ther. 2014;40(11–12):1349–58. pmid:25270840
  18. 18. Levy RL, Whitehead WE, Walker LS, Von Korff M, Feld AD, Garner M, et al. Increased somatic complaints and health-care utilization in children: effects of parent IBS status and parent response to gastrointestinal symptoms. Am J Gastroenterol. 2004;99(12):2442–51. pmid:15571594
  19. 19. Pedregosa F, Varoquaux G, Gramfort A, Michel V, Thirion B, Grisel O. Scikit-learn: Machine learning in Python. The Journal of Machine Learning Research. 2011;12:2825–30.
  20. 20. McInnes L, Healy J, Melville J. UMAP: uniform manifold approximation and projection for dimension reduction. arXiv. 2018. http://arxiv.org/abs/1802.03426
  21. 21. Melvin RL, Xiao J, Godwin RC, Berenhaut KS, Salsbury FR Jr. Visualizing correlated motion with HDBSCAN clustering. Protein Sci. 2018;27(1):62–75. pmid:28799290
  22. 22. Campello RJGB, Moulavi D, Sander J. Density-based clustering based on hierarchical density estimates. In: Advances in knowledge discovery and data mining. Berlin, Heidelberg: Springer Berlin Heidelberg; 2013. 160–72.
  23. 23. Takahashi K, Sato H, Shimamura Y, Abe H, Shiwaku H, Shiota J, et al. Persistent body-weight change on achalasia and peroral endoscopic myotomy: a multicenter cohort study. J Gastroenterol. 2024.
  24. 24. Maruyama H, Takahashi K, Kojima K, Nakajima N, Sato H, Mizuno K-I, et al. Machine-learning prediction of bleeding after endoscopic submucosal dissection for early gastric cancer: a multicenter study. JGH Open. 2025;9(7):e70203. pmid:40589769
  25. 25. Lundberg S, Lee SI. A unified approach to interpreting model predictions. arXiv, 2017. http://arxiv.org/abs/1705.07874
  26. 26. Lundberg SM, Erion GG, Lee SI. Consistent individualized feature attribution for tree ensembles. arXiv. 2018. http://arxiv.org/abs/1802.03888
  27. 27. Kanda Y. Investigation of the freely available easy-to-use software “EZR” for medical statistics. Bone Marrow Transplant. 2013;48(3):452–8. pmid:23208313
  28. 28. Sherman AL, Bruehl S, Smith CA, Walker LS. Individual and additive effects of mothers’ and fathers’ chronic pain on health outcomes in young adults with a childhood history of functional abdominal pain. J Pediatr Psychol. 2013;38(4):365–75. pmid:23335355
  29. 29. Van Der Veek SMC, Derkx HHF, De Haan E, Benninga MA, Plak RD, Boer F. Do parents maintain or exacerbate pediatric functional abdominal pain? A systematic review and meta-analysis. J Health Psychol. 2012;17(2):258–72. pmid:21708865
  30. 30. Walker LS, Smith CA, Garber J, Van Slyke DA. Development and validation of the pain response inventory for children. Psychol Assess. 1997;9:392–405.
  31. 31. D’Amato M. Genes and functional GI disorders: from casual to causal relationship. Neurogastroenterol Motil. 2013;25(8):638–49. pmid:23826979
  32. 32. Thapar N, Benninga MA, Crowell MD, Di Lorenzo C, Mack I, Nurko S, et al. Paediatric functional abdominal pain disorders. Nat Rev Dis Primers. 2020;6(1):89. pmid:33154368
  33. 33. Chiou E, Nurko S. Functional abdominal pain and irritable bowel syndrome in children and adolescents. Therapy. 2011;8(3):315–31. pmid:21731470
  34. 34. Chen M, Ruan G, Chen L, Ying S, Li G, Xu F, et al. Neurotransmitter and intestinal interactions: focus on the microbiota-gut-brain axis in irritable bowel syndrome. Front Endocrinol (Lausanne). 2022;13:817100. pmid:35250873
  35. 35. Jones MP, Walker MM, Ford AC, Talley NJ. The overlap of atopy and functional gastrointestinal disorders among 23,471 patients in primary care. Aliment Pharmacol Ther. 2014;40(4):382–91. pmid:24961872
  36. 36. Takahashi K, Khwaja IG, Schreyer JR, Bulmer D, Peiris M, Terai S, et al. Post-inflammatory abdominal pain in patients with inflammatory bowel disease during remission: a comprehensive review. Crohns Colitis 360. 2021;3(4):otab073. pmid:36777266
  37. 37. Aguilera-Lizarraga J, Florens MV, Viola MF, Jain P, Decraecker L, Appeltans I, et al. Local immune response to food antigens drives meal-induced abdominal pain. Nature. 2021;590(7844):151–6. pmid:33442055
  38. 38. Decraecker L, De Looze D, Hirsch DP, De Schepper H, Arts J, Caenepeel P, et al. Treatment of non-constipated irritable bowel syndrome with the histamine 1 receptor antagonist ebastine: a randomised, double-blind, placebo-controlled trial. Gut. 2024;73(3):459–69. pmid:38191268
  39. 39. Levy RL, Langer SL, Walker LS, Romano JM, Christie DL, Youssef N, et al. Cognitive-behavioral therapy for children with functional abdominal pain and their parents decreases pain and other symptoms. Am J Gastroenterol. 2010;105(4):946–56. pmid:20216531
  40. 40. Zhou Q, Verne GN. Epigenetic modulation of visceral nociception. Neurogastroenterol Motil. 2022;34(9):e14443. pmid:35950237
  41. 41. Gibler RC, Jastrowski Mano KE. Systematic review of autonomic nervous system functioning in pediatric chronic pain. Clin J Pain. 2021;37(4):281–94. pmid:33656000
  42. 42. Rajindrajith S, Zeevenhooven J, Devanarayana NM, Perera BJC, Benninga MA. Functional abdominal pain disorders in children. Expert Rev Gastroenterol Hepatol. 2018;12(4):369–90. pmid:29406791
  43. 43. Petherick ES, Pearce N, Sunyer J, Wright J. Ethnic and socio-economic differences in the prevalence of wheeze, severe wheeze, asthma, eczema and medication usage at 4 years of age: findings from the Born in Bradford birth cohort. Respir Med. 2016;119:122–9. pmid:27692132
  44. 44. Grøholt E-K, Stigum H, Nordhagen R, Köhler L. Recurrent pain in children, socio-economic factors and accumulation in families. Eur J Epidemiol. 2003;18(10):965–75. pmid:14598927
  45. 45. Bradford Institute for Health Research. Born in Bradford. Evidence briefing: genes and health – inheritance and risk. 2022. https://borninbradford.nhs.uk/wp-content/uploads/2023/04/HG2954-BIHR-BiB-Evidence-Briefing-Genes-and-Health-4.pdf#:~:text=Evidence%20from%20the%20Born%20in,UK%20this%20fell%20to%2030
  46. 46. Small N, Kelly B, Malawsky DS, Lodh R, Oddie S, Wright J. Mortality, morbidity and educational outcomes in children of consanguineous parents in the Born in Bradford cohort. Wellcome Open Res. 2024;9:319. pmid:39372840
  47. 47. Goudman L, Demuyser T, Pilitsis JG, Billot M, Roulaud M, Rigoard P, et al. Gut dysbiosis in patients with chronic pain: a systematic review and meta-analysis. Front Immunol. 2024;15:1342833. pmid:38352865
  48. 48. Shulman RJ, Devaraj S, Heitkemper M. Activation of the innate immune system in children with irritable bowel syndrome evidenced by increased fecal human β-defensin-2. Clin Gastroenterol Hepatol. 2021;19(10):2121–7. pmid:32961343
  49. 49. Castillo DF, Denson LA, Haslam DB, Hommel KA, Ollberding NJ, Sahay R, et al. The microbiome in adolescents with irritable bowel syndrome and changes with percutaneous electrical nerve field stimulation. Neurogastroenterol Motil. 2023;35(7):e14573. pmid:37092330
  50. 50. Oishi K, Nakano N, Ota M, Inage E, Izawa K, Kaitani A, et al. MHC class II-expressing mucosal mast cells promote intestinal mast cell hyperplasia in a mouse model of food allergy. Allergy. 2025;80(8):2297–309. pmid:39868907
  51. 51. Liu F, Panagiotakos D. Real-world data: a brief review of the methods, applications, challenges and opportunities. BMC Med Res Methodol. 2022;22(1):287. pmid:36335315