Photocatalytic nitrogen fixation offers an efficient, environmentally friendly, and energy-saving approach for ammonia synthesis. In this study, semiconductor materials, particularly graphitic carbon nitride (g-C 3 N 4 ) combined with single metal atoms, were theoretically investigated to identify promising candidates as nitrogen fixation photocatalysts. Initially, six different single 3d transition-metal atoms, i.e., V, Mn, Fe, Co, Ni, and Cu, were loaded onto g-C 3 N 4 , and the optimal single-atom catalyst, Fe@g-C 3 N 4 , was selected through reaction energy calculations. This catalyst demonstrated excellent performance in terms of the electronic structure and light absorption properties. Furthermore, machine learning methods were applied to a limited sample set to predict a catalyst with a superior performance beyond the computational samples. Utilizing a backward elimination method and sure independence screening and sparsifying operator (SISSO) training, the key descriptors correlated with the target properties of the catalysts were identified. The SISSO descriptors, consisting of structural and electronic characteristic parameters, are interpretable and provide meaningful insights. Importantly, a catalyst, Ru@g-C 3 N 4 , with outstanding performance was predicted and verified by density functional theory calculations. This catalyst design strategy demonstrates promising results with limited computational data, highlighting the potential of combining theoretical simulations with machine learning methods for catalyst design.