Wastewater treatment is essential for protecting both the environment and public health. With a growing global population and concerns about water shortages, wastewater must be treated effectively to meet the increasing demand for drinking water. Wastewater treatment plants (WWTP) that use innovative technologies, such as machine learning (ML), are playing a leading role in addressing this challenge. This study aims to use advanced ML algorithms to predict parameters in WWTP Kenitra, such as total suspended solids (TSS), chemical oxygen demand (COD), and biological oxygen demand (BOD). Four ML models were evaluated, including random forest (RF), decision tree regressor (DTR), Gaussian process regressor (GPR), and adaptive boosting regression (AdaBoost-R). The coefficient of determination (R2) and accuracy were used to evaluate the algorithm’s efficiency, R2 values of 0.99, 0.93, and 0.96 were obtained by the DTR, reflecting exceptional performance with RMSE values of 1.33 mg∙dm−3 for TSS, 3.85 mg∙dm−3 for COD, and 2.32 mg∙dm−3 for BOD. The GPR demonstrated strong predictive capability, achieving R2 values of 0.92 for TSS and 0.97 for BOD, with corresponding RMSE values of 3.12 mg∙dm−3, and 2.67 mg∙dm−3, respectively. These results indicate that the DTR and GPR learning models provide better algorithms for evaluating wastewater parameters. In particular, the study demonstrates the main benefits of using ML algorithms to predict the parameters of WWTP. This study illustrates that the DTR optimises treatment solutions and monitors the treatment process. The proposed method outperforms other algorithms in terms of efficiency and provides an accurate way to improve the performance of WWTP.