ObjectiveIn this study, we investigated the effects of endocrine therapy and related drugs on the body composition and bone metabolism of patients with breast cancer. Additionally, using body composition-related indicators in machine learning algorithms, the risks of osteoporosis in patients with breast cancer and healthy women were predicted.MethodsWe enrolled postmenopausal patients with breast cancer who were hospitalized in a tertiary hospital and postmenopausal women undergoing health checkups in our hospital between 2019 and 2021. The basic information, body composition, bone density-related indicators, and bone metabolism-related indicators of all the study subjects were recorded. Machine learning models were constructed using cross-validation.ResultsCompared with a healthy population, the body composition of patients with breast cancer was low in bone mass, protein, body fat percentage, muscle, and basal metabolism, whereas total water, intracellular fluid, extracellular fluid, and waist-to-hip ratio were high. In patients with breast cancer, the bone mineral density (BMD), Z value, and T value were low and the proportion of bone loss and osteoporosis was high. BMD in patients with breast cancer was negatively correlated with age, endocrine therapy status, duration of medication, and duration of menopause, and it was positively correlated with body mass index (BMI) and basal metabolism. The parameters including body composition, age, hormone receptor status, and medication type were used for developing the machine learning model to predict osteoporosis risk in patients with breast cancer and healthy populations. The model showed a high accuracy in predicting osteoporosis, reflecting the predictive value of the model.ConclusionsPatients with breast cancer may have changed body composition and BMD. Compared with the healthy population, the main indicators of osteoporosis in patients with breast cancer were reduced nonadipose tissue, increased risk of edema, altered fat distribution, and reduced BMD. In addition to age, duration of treatment, and duration of menopause, body composition-related indicators such as BMI and basal metabolism may be considerably associated with BMD of patients with breast cancer, suggesting that BMD status can be monitored in clinical practice by focusing on changes in the aforementioned indexes, which may provide a way to prevent preclinical osteoporosis.