Hence, this study utilized various machine learning models for prediction and showed that factors such as smoking history, hypertension, and opioids are associated with thyroid-related adverse events in cancer patients receiving PD-1/PD-L1 inhibitors. This evidence concerns the gene CD274 and thyroid gland disorder.