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