Existing prediction models have low prediction accuracy for surface water pollution with many influencing factors. Taking algal bloom prediction as the entry point of surface water pollution research, LASSO-LARS algorithm is adopted to select the main factors affecting algal bloom variables. At the same time, combined with BP neural network in machine learning, a surface water pollution prediction model based on machine learning is proposed. The results show that the proposed method can accurately predict the algal blooms by using the BP neural network algal bloom prediction model, where the LASSO-LARS algorithm is used to select the variables, such as water temperature, pH, transparency, conductivity, dissolved oxygen, ammonia nitrogen, and chlorophyll a, as model inputs, and the relative error of prediction is less than 5.2%. Thus, the proposed method has certain validity and practical application value.