Abstract Background This multicenter observational study aimed to determine whether dyslipidemia or obesity contributes more significantly to unfavorable clinical outcomes in patients experiencing a first-ever ischemic stroke (IS). Methods The study employed a machine learning predictive model to investigate associations among body mass index (BMI), body fat percentage (BFP), high-density lipoprotein (HDL), triglycerides (TG), and total cholesterol (TC) with adverse outcomes in IS patients. Extensive real-world clinical data was utilized, and risk factors significantly linked to adverse outcomes were identified through multivariate analysis, propensity score matching (PSM), and regression discontinuity design (RDD) techniques. Furthermore, these findings were validated via a nationwide multicenter prospective cohort study. Results In the derived cohort, a total of 45,162 patients diagnosed with IS were assessed, with 522 experiencing adverse outcomes. A multifactorial analysis incorporating PSM and RDD methods identified TG (adjusted odds ratio (OR) = 1.110; 95% confidence interval (CI): 1.041–1.183; P