Abstract Background: The definition of metabolically healthy and unhealthy obesity for cancer risk remains uncertain and controversial. This study proposed a novel classifier based on biomarkers selected using machine learning (ML) and compared its risk stratification with the conventional definition. Methods: A prospective cohort study was conducted of 317,569 UK Biobank participants who were free of cancer and with body mass index (BMI) ≥18.5 kg/m2 at baseline. Individuals were classified into metabolically healthy and non-obese (MHNO), metabolically unhealthy and non-obese (MUNO), metabolically healthy and obese (MHO), and metabolically unhealthy and obese (MUO), according to body mass index (BMI) and six metabolic criteria. For the ML approach, LASSO regularization was used to select a subset from seventeen metabolic biomarkers to optimize C index. Clinical cut-off value was applied to this subset to define MHO. Multivariable Cox proportional hazards models were used to estimate hazard ratios (HRs) of total, obesity-related, type two diabetes (T2D)-related, and 23 site-specific cancers according to the conventional and ML definitions. Findings: Of 21 biomarkers, 17 were selected using LASSO. Compared with MHNO, individuals with MHO had higher risk of obesity-related cancer (HRconventional 1.22, 95% CI 1.15-1.29; HRML 1.23, 95% CI 1.16-1.30) and T2D-related cancer (HRconventional 1.25, 95% CI 1.19-1.39; HRML 1.27, 95% CI 1.20-1.34) after adjusting for sociodemographic and lifestyle factors. ML-defined metabolic status better-stratified individuals with normal weight for risk of total cancer (HRconventional1.02, 95% CI 0.99 -1.06; HRML 1.06, 95% CI 1.02 - 1.10) and some site-specific cancers, e.g., hepatocellular carcinoma (HRconventional 0.89, 95% CI, 0.53-1.48; HRML 2.52, 95% CI, 1.85-3.45). Interpretation: Compared with the conventional definition of metabolic health, a broader array of metabolic markers may help better stratify individuals for cancer risk. Keywords: Obesity, cancer, metabolically healthy obesity, hepatocellular carcinoma. Citation Format: Ziyi Zhou, Solange Parra-Soto, Yujia Lu, Zhe Fang, Kai Wang, Alaina Bever, Liyuan Tao, Fanny Petermann-Rocha, Jirapitcha Boonpor, Naveed Sattar, Carlos Celis-Morales, Jill P. Pell, Frederick K. Ho, Mingyang Song. Defining metabolically healthy and unhealthy obesity in relation to cancer risk: A prospective cohort study by using a machine learning approach in comparison with conventional definitions in the UK Biobank [abstract]. In: Proceedings of the American Association for Cancer Research Annual Meeting 2024; Part 1 (Regular Abstracts); 2024 Apr 5-10; San Diego, CA. Philadelphia (PA): AACR; Cancer Res 2024;84(6_Suppl):Abstract nr 4870.