# Social anxiety prediction model for nursing students based on machine learning: a cross-sectional survey

**Authors:** Fang Wang, Pingping Xu, Yelin Huang, Li Liu, Liuliu Kong, Fan Yang

PMC · DOI: 10.3389/fpsyt.2025.1721618 · 2025-12-12

## TL;DR

This study uses machine learning to predict social anxiety in nursing students and finds that random forests perform best.

## Contribution

A novel machine learning-based prediction model for social anxiety in nursing students using random forest algorithm.

## Key findings

- Random forest model achieved the highest AUC of 0.71 for predicting social anxiety.
- Key predictors include sleep condition, alexithymia, depression, education level, and religious belief.

## Abstract

The purpose of this study is to use a variety of machine learning (ML) algorithms to build a risk prediction model for nursing students’ social anxiety, select the optimal model, and identify risk factors.

The cross-sectional survey was conducted among nursing students at 10 universities from September to December 2024. A total of 2024 nursing students were included in this study. Nine acceptable features were selected through Logistic analysis. We developed and evaluated seven ML models: Logistic regression (LR), Elastic net (EN), k-nearest neighbors (KNN), Decision tree (DT), Extreme gradient boosting (XGBoost), Support vector machine (SVM), Random forest (RF).

The area under the Area Under Curve (AUC: 0.71) of the random forest model was the highest among the 7 models that predicted nursing students’ social anxiety. The most important characteristics that predicted social anxiety in nursing students included Sleep condition, alexithymia, depression, education level, and religious belief.

Our findings suggest that ML models, specifically random forests, can best predict the risk of social anxiety among nursing students.

## Full-text entities

- **Diseases:** depression (MESH:D003866), Social anxiety (MESH:D000072861)

## Figures

5 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12766779/full.md

---
Source: https://tomesphere.com/paper/PMC12766779