Machine learning prediction of food addiction in university students using demographic, anthropometric and personality traits

Machine Learning


Data preprocessing

In this pilot study, 210 students were participated. Table 1 shows the basic information about students at three levels of food addiction. In this study the food addiction score was divided into three tertiles (low, medium and high). Students with medium and high score were considered as food-addicted. Food-addicted students had significantly higher body weight and body mass index (BMI). In addition, they were younger than those at the low level of food addiction. (p = 00.7, p < 0.001 and p = 0.001 respectively).

Table 1 Basic information of students based on the food addiction scale.

The dataset underwent preprocessing to address class imbalance through the use of Tomek Links and SMOTE. The summary of the dataset before and after these techniques is presented in Table 2.

Table 2 The summary of the dataset before and after Tomek links and SMOTE techniques.

The initial dataset consisted of 210 samples, predominantly belonging to class 0. After applying Tomek Links, which helped eliminate noise and clarify the decision boundary, we reduced the dataset to 205 samples, with class distributions improving slightly. The application of SMOTE was crucial, effectively balancing the classes to equal distribution in the final dataset of 350 samples, which facilitated more robust training and testing phases (Fig. 1).

Fig. 1
Fig. 1The alternative text for this image may have been generated using AI.

Class distribution before and after resampling.

Model performance

Comparative heatmap of classification Accuracy across ten machine learning algorithms and twelve feature selection techniques. The vertical axis represents the classifiers, while the horizontal axis denotes the feature selection methods. Warmer colors (yellow) indicate higher accuracy, highlighting the superior performance of ensemble methods like CatBoost and Random Forest.

The comparative analysis of ten machine learning algorithms combined with twelve feature selection techniques revealed distinct and consistent patterns in predicting food addiction.

As shown in Fig. 2 (Accuracy) and Fig. 3 (F1-Score), ensemble methods particularly the CatBoostClassifier and Random Forest consistently outperformed single estimators. These figures clearly indicate that ensemble methods (CatBoost, Random Forest, LGBMClassifier) consistently occupy the high-performance region (yellow/green), while single estimators (GaussianNB, Decision Tree) and the use of PCA occupy the low-performance region (dark blue/purple). The best overall performance was achieved by the CatBoostClassifier, which reached a maximum Accuracy of 0.84 and an F1-Score of 0.84 when combined with feature selection methods like L1 Regularization or Mutual Information. This suggests that gradient boosting effectively handles the non-linear complexities of food addiction patterns present in the balanced dataset.

Fig. 2
Fig. 2The alternative text for this image may have been generated using AI.

Accuracy by feature selection method.

.

Fig. 3
Fig. 3The alternative text for this image may have been generated using AI.

F1 Score by Feature Selection Method. Heatmap of F1-Scores, representing the harmonic mean of precision and recall. High F1-scores demonstrate the robustness of Gradient Boosting and Random Forest classifiers in effectively balancing false positives and false negatives compared to single estimators.

Figure 4 (AUC), which measures the models’ discriminative power, highlighted exceptional performance from both the Random Forest and SVC models when paired with L1 Regularization, with both reaching a peak AUC of 0.91. This high AUC value indicates superior capability in correctly ranking positive instances.

Fig. 4
Fig. 4The alternative text for this image may have been generated using AI.

AUC by feature selection method. This metric quantifies the models’ discriminative power. Notably, both Support SVC and Random Forest achieved a peak AUC of 0.91 when coupled with L1 Regularization, outperforming other combinations.

Precision performance heatmap across classifier-feature selection pairs. Higher values (yellow) indicate a lower rate of false positives, with CatBoost and Random Forest exhibiting high precision across most feature selection methods.

Recall analysis of the machine learning models. This metric reflects the classifiers’ ability to correctly identify positive instances. The heatmap reveals a consistent drop in recall when utilizing PCA (purple column), contrasting with the high recall rates achieved by tree-based feature selection methods.

The analysis of Precision (Fig. 5) and Recall (Fig. 6) confirms the balanced nature and reliability of the top performing models. The CatBoost model maintained a high balance between Precision (0.85) and Recall (0.84). This balance is crucial in medical/behavioral classification, as it minimizes both false positives and false negatives. Simple estimators like Gaussian Naive Bayes and the Decision Tree consistently produced the lowest metrics (often below 0.75 in Accuracy, F1, Precision, and Recall). This highlights the necessity of ensemble techniques (like Random Forest and CatBoost) to reduce variance and improve the robustness of the classification on this dataset.

Fig. 5
Fig. 5The alternative text for this image may have been generated using AI.

Precision by feature selection method.

Fig. 6
Fig. 6The alternative text for this image may have been generated using AI.

Recall by Feature Selection Method.

Comparison of feature selection methods

The choice of feature selection strategy significantly influenced the model performance. Lasso, Random Forest Importance, and Mutual Information consistently yielded the highest metrics across almost all classifiers. For instance, L1 Regularization enabled the SVC to achieve its peak AUC of 0.91. PCA demonstrated the poorest generalization capability across the board. Using PCA caused a substantial drop in Accuracy for most models, falling into the 0.69 to 0.74 range. This indicates that transforming the original feature space into principal components resulted in a loss of critical variance necessary for effective class separation.

Importance histogram

To enhance the interpretability and clinical relevance of one of the top-performing predictive models, the CatBoost Classifier, which is particularly well-suited for stable and reliable feature importance estimation a comprehensive feature importance analysis was conducted. This approach moves beyond simple “black-box” predictions, elucidating the underlying decision-making process by quantifying the relative contribution of each input variable to the prediction of Food Addiction risk. Figure 7 illustrates the top 20 most influential features, ranked by their importance scores. These scores reflect the degree to which a feature effectively splits the data and reduces uncertainty regarding the target variable across the ensemble of decision trees.

The analysis reveals an overwhelming dominance of psychological and emotional state variables over other feature categories. The feature “Sometimes I feel completely worthless” emerged as the single most critical predictor, attaining the highest Importance Score (exceeding 1.4). This finding provides robust empirical evidence suggesting that low self-esteem and a negative self-concept are central drivers of food addiction, aligning strongly with the Self-Medication Hypothesis, where individuals employ maladaptive eating behaviors to cope with feelings of shame or inadequacy. Following closely is the variable “When I am under a lot of mental pressure, sometimes I feel like I am breaking down.” The high ranking of this feature clearly indicates that stress intolerance and emotional dysregulation are key differentiators for Food Addiction risk. The model effectively identified that the inability to process high -stress situations psychologically often translate into somatic and behavioral responses, notably binge eating.

Intriguingly, the second most important feature identified was “If necessary, I can skillfully employ others to achieve my goals.” While this feature is less intuitively linked to eating behaviors than stress, its prominence may reflect a broader personality profile possibly characterized by high impulsivity or a need for external control which manifests both socially (in interpersonal dynamics) and behaviorally (in eating habits). Furthermore, “I often get angry about how others treat me” highlights the significant role of interpersonal sensitivity and hostility. This supports the notion that social friction, perceived slights, and the resulting negative effect (anger, resentment) serve as potent triggers for addictive eating patterns.

While psychological factors form the cornerstone of the predictive model, anthropometric indicators also remain significant. “Weight” ranked third, positioning it higher than “BMI (Body Mass Index),” which appeared in the lower-middle section of the top 20. The prioritization of “Weight” over the ratio-based “BMI” suggests that raw body mass might have a specific nonlinear or complex interaction relationship with the target labels that the CatBoost algorithm effectively captured. Nevertheless, the presence of these metrics confirms the bidirectional relationship between physical status and Food Addiction risk. Crucially, the model’s structure clearly signals that the psychological root and emotional vulnerability are stronger predictive factors than the physical outcome itself.

Fig. 7
Fig. 7The alternative text for this image may have been generated using AI.

SHAP feature importance plot showing the top 20 most influential features across the bests performing model.

SHAP value histogram

The objective of this analysis was to provide a transparent and fine-grained explanation of how the CatBoost Classifier leverages questionnaire-based information to estimate the risk of food addiction among participants. Given its competitive predictive performance and its strong compatibility with TreeSHAP-based interpretability frameworks, the CatBoost Classifier was selected for SHAP analysis to provide a transparent, fine-grained, and clinically interpretable explanation of how questionnaire-based features contribute to the estimation of food addiction risk. Compared with alternative ensemble models, CatBoost yields more consistent and less noisy SHAP value distributions, thereby facilitating clearer visualization and more robust interpretation of feature effects. The SHAP (SHapley Additive exPlanations) summary plot presented in Fig. 8 elucidates this process by quantifying the contribution of each feature (SHAP value) to the model’s final prediction for every individual observation. Positive SHAP values indicate an increased likelihood of food addiction (positive class), whereas negative values represent a mitigating or protective effect (negative class). The color gradient of the points reflects the magnitude of the original feature values, with red denoting higher values and blue indicating lower values.

Overall, the SHAP analysis reveals that the CatBoost model predominantly relies on a cluster of psychologically salient features, particularly those related to negative self-concept, emotional vulnerability, and cognitive behavioral rigidity, to drive its predictions.

The strongest contributors to food addiction risk are core psychological features associated with impaired self-perception and emotional dysregulation. Among all variables, the item “Sometimes I feel completely worthless” emerges as the most influential predictor, exerting a markedly dominant positive effect on the model output. High responses to this item consistently push SHAP values strongly toward the positive direction, often exceeding + 1.5, indicating a robust and near-linear relationship between severe reductions in self-esteem and elevated food addiction risk. Within the model architecture, this variable functions as a necessary risk factor, meaning that elevated predicted risk is rarely observed in its absence.

Closely following this factor is the item “When I am under a lot of stress, I sometimes feel like I am falling apart, which captures poor stress tolerance and catastrophic emotional responses. High values for this feature are densely concentrated on the positive side of the SHAP axis, underscoring emotional dysregulation under stress as a fundamental mechanism underlying maladaptive eating behaviors. Similarly, the statement “I often feel nervous and tense, reflecting a tendency toward neuroticism, contributes positively and consistently to the prediction, albeit with a slightly smaller effect size. Together, these features form the psychological core of the model’s decision-making process.

In contrast, anthropometric variables and certain personality traits play a secondary but still meaningful role. Body weight demonstrates a clear positive association with food addiction risk, as higher values consistently shift the prediction toward the positive class. This pattern highlights the interaction between physical status and addictive eating behaviors. Height, while less influential, shows a more dispersed distribution around the SHAP zero line, suggesting a weaker and less stable contribution.

Several personality-related control features further refine the model’s predictions. The item “If necessary, I can skillfully use others to achieve my goals” shows a strong and concentrated positive SHAP contribution at higher values. This finding may reflect traits related to interpersonal control, instrumental behavior, or narcissistic tendencies, which appear to overlap with vulnerability to addictive patterns. Likewise, “I am rigid and inflexible in my ways” exhibits a positive SHAP contribution at higher scores, indicating that cognitive and behavioral inflexibility may predispose individuals to difficulties in regulating eating behaviors and adapting to healthier coping strategies.

Interpersonal and affective factors also contribute meaningfully, though with slightly lower overall importance. The item “I often get angry about how others treat me, associated with hostility and interpersonal sensitivity, shows a clear positive influence when endorsed at higher levels. This supports the notion that unresolved anger and relational conflict may act as emotional triggers for compensatory eating. Similarly, “I am sensitive and suspicious of others’ intentions” demonstrates a positive SHAP contribution at higher values, potentially reflecting social withdrawal, mistrust, or heightened control needs that may indirectly promote reliance on food as an emotional substitute.

Conversely, several features exhibit protective or moderating effects. The statement “I am a happy and good-spirited person” shows high values clustering on the negative side of the SHAP axis, indicating a consistent risk-reducing effect. This finding highlights the buffering role of positive affect against food addiction vulnerability. In a similar vein, “I can organize my tasks well to get them done on time, a marker of conscientiousness, tends to have SHAP values near zero or slightly negative, suggesting a mild but meaningful protective influence through improved self-regulation and behavioral planning.

Finally, a subset of variables demonstrates negligible or highly variable influence on the model’s predictions. Items such as “Once I find the right way to do something, I repeat that method every time” or “I think listening to conflicting viewpoints only confuses students” show SHAP values tightly clustered around zero regardless of their original magnitude. This concentration indicates that fluctuations in these features do not meaningfully alter the predicted risk of food addiction and that they contribute little to the model’s overall explanatory power.

By decomposing individual predictions into interpretable feature-level contributions, this analysis substantially enhances model transparency and clinical interpretability. Importantly, these findings also delineate clear psychological targets for preventive and therapeutic interventions, suggesting that strategies aimed at improving self-esteem, emotional regulation, and cognitive flexibility may be especially effective in mitigating food addiction risk.

Fig. 8
Fig. 8The alternative text for this image may have been generated using AI.

SHAP Value Histogram plot showing the top 20 most influential features across the bests performing model.



Source link