OBJECTIVEBreast cancer is the most common cancer in women, threatening both physical and mental health. The epidemiological evidence for association between sleep duration, depression and breast cancer is inconsistent. The aim of this study was to determine the association between them and build machine-learning algorithms to predict breast cancer.METHODSA total of 1,789 participants from the National Health and Nutrition Examination Survey (NHANES) were included in the study, and 263 breast cancer patients were identified. Sleep duration was collected using a standardized questionnaire, and the Nine-item Patient Health Questionnaire (PHQ-9) was used to assess depression. Logistic regression yielded multivariable-adjusted breast cancer odds ratios (OR) and 95% confidence intervals (CI) for sleep duration and depression. Then, six machine learning algorithms, including AdaBoost, random forest, Boost tree, artificial neural network, limit gradient enhancement and support vector machine, were used to predict the development of breast cancer and find out the best algorithm.RESULTSBody mass index (BMI), race and smoking were statistically different between breast cancer and non-breast cancer groups. Participants with depression were associated with breast cancer (OR = 1.99, 95%CI: 1.55-3.51). Compared with 7-9h of sleep, the ORs for <7 and >9 h of sleep were 1.25 (95% CI: 0.85-1.37) and 1.05 (95% CI: 0.95-1.15), respectively. The AdaBoost model outperformed other machine learning algorithms and predicted well for breast cancer, with an area under curve (AUC) of 0.84 (95%CI: 0.81-0.87).CONCLUSIONSNo significant association was observed between sleep duration and breast cancer, and participants with depression were associated with an increased risk for breast cancer. This finding provides new clues into the relationship between breast cancer and depression and sleep duration, and provides potential evidence for subsequent studies of pathological mechanisms.