Electrochemically induced precipitation methods for phosphorous removal and recovery have received increasing attention, which have the advantage of achieving phosphorous recovery without the use of additional chemicals. In this work, a novel integrated electrochemical fixed bed packed with magnetite (EPM) for the removal of phosphorous was designed and constructed. To achieve control automatically, machine learning technology was utilized in this study. Accurately predicting the phosphorous removal efficiency and cost is the goal for model training and development. The artificial neural network (ANN), random forest (RF), and multiple linear regression (MLR) models were implemented using the experimental data of EPM. The MLR model showed poor prediction accuracy, indicating that the linear model is insufficient to describe the EPM process. ANN and RF achieved an acceptable accuracy in predicting phosphorous removal and cost, which were optimized using a grid-searching method and deeply analyzed by variable importance to identify the importance of variables. According to the machine learning model, the current, feed rate, and Ca 2+ concentration have a significant role in the efficiency and cost of phosphorous removal. Future research should focus on data collection for electrochemical systems in actual operations, as well as designing and optimizing machine learning models suitable to electrochemical systems on automation.