Our investigation identified 11 genes associated with endometriosis risk, with AGPAT4 and COMT emerging as pivotal biomarkers through machine learning analysis. Here, AGPAT4 is linked to endometriosis.