Using machine learning, we screened RAD51D and XRCC2 in the homologous recombination pathway as diagnostic biomarkers for gastric cancer. Here, RAD51D is linked to gastric cancer.