The selection of electron donors and nonfullerene acceptors (NFAs) in organic solar cells (OSCs) is crucial for improving photovoltaic performance. Machine learning (ML) has brought a breakthrough solution. Herein, 292 donor‐NFA pairs with experimental OSC parameters from the reported articles are collected. The ML descriptors include device processing parameters, molecular properties, and molecular structure. The five ML regression models, random forest (RF), extra tree regression, gradient boosting regression tree, adaptive boosting, and artificial neural network (ANN) are trained. GridSearchCV is used for hyperparameter optimization of ML regression models. The SHapley Additive exPlanation approach is employed to analyze descriptor importance. Among the trained five ML models, the RF model shows superior performance, achieving Pearson's correlation coefficient (r) of 0.81 on the test set. Based on the donors and NFAs in constructed dataset, the 9779 donor–NFA pairs for OSCs are generated by randomly combining donor and acceptor molecules. The trained RF model is utilized to predict the power conversion efficiency (PCE) of new donor–acceptor pairs for OSCs. The results indicate that the OSC composed of PBDB‐TF as donor and L8‐BO as acceptor can achieve the remarkable PCE of 17.9%.