Microalgae-based nutrient recovery has the potential to efficiently recover nutrients while simultaneously treating wastewater. However, the absence of an optimization model for this technology hinders its full potential. This study has developed a model to optimize the biomass yield in micro algae-based wastewater treatment. Seven machine learning models, including Decision Trees (DT), Random Forest (RF), K-Nearest Neighbours (KNN), Gradient Boosting Regressor (GBR), Multi-Layer Perceptron Regression (MLPR), Support Vector Regression (SVR), and Artificial Neural Networks (ANN), were compared. Among other algorithms, ANN performed superiorly, achieving an R2 value of 0.98 with the lowest error. The optimal biomass yield of 948 mg/L was obtained when the COD, phosphate, nitrate, nitrite, pH, and retention times were maintained at 350 mg/L, 50 mg/L, 60 mg/L, 140 mg/L, 7.1, 9 days respectively. When compared to experimental yield, the prediction shows 31.7 % higher biomass yield. The pH and retention time were the critical factors for prediction of algal biomass. 20 % of variation in the train test split ratio caused 21 % increase in the error value and 75:25 ratio was found to be optimal for better performance of the model. This study serves as a valuable reference point for integration of artificial intelligence (AI) with algae-based wastewater treatment. © 2024 Elsevier Ltd