Cervical cancer (CC) seriously threatens women's health. Precisely identifying its risk factors and constructing a reliable prediction model are of utmost importance for reducing the risks of both its occurrence and mortality. This study was precisely carried out based on such a need. This study aims to analyse the association between variables and cervical cancer, construct an effective risk prediction model, and evaluate its performance, thereby providing a basis for cervical cancer risk assessment and prevention. Using data from the US NHIS from 2019 to 2023, we analysed the association between 13 variables and cervical cancer, screened key classification variables using machine learning algorithms, and constructed a predictive model based on these variables. We then plotted nomograms, ROC curves, calibration curves, and decision curves to evaluate the model's performance. Four of the 13 variables were significantly correlated with CC (P < 0.001). Among the 38 categorical variables, the machine learning algorithm identified seven key variables. The nomogram constructed based on these variables demonstrated good predictive ability, with an AUC of 0.82, high accuracy in distinguishing CC patients from non-patients, calibration curves confirming its accuracy, and decision curves showing a net benefit greater than 0. In this study, key factors related to CC were screened out through machine learning, and an effective nomogram risk prediction model was constructed. It provided valuable insights for the risk assessment, prevention, and personalized intervention of CC, thus contributing to better clinical management of CC.