A study investigated polycystic ovary syndrome (PCOS) using bioinformatics to identify androgen-related genes (ARGs). Data from five GEO files (GSE34526, GSE80432, GSE95728, GSE124226, GSE137684) comprising 26 healthy and 34 PCOS samples were analyzed. 13 key ARGs were identified by LASSO, 10 by random forest and 19 by PPI network. The integration of the three methods selected four fungal ARGs: ALDH1A1, DHRS9, PRKCB and SGPL1. Based on these, they created a nomogram to predict the risk of PCOS. RT-qPCR validation on ovarian tissues of PCOS mice confirmed decreased expression of DHRS9, SGPL1 and ALDH1A1, while PRKCB was increased. The samples were divided into two ARG clusters with different immune infiltrations, and the ARG score was higher in cluster A. The results clarify the pathogenesis of PCOS and suggest new biomarkers for diagnosis and treatment.